       }
     }
 
-    void swap() {}
-
-    // XXX: generalize using a lambda
-    void fill() {}
-    void zero() {}
+    void swap(array_t& other) noexcept
+    {
+      array<type_t, this->size> temp;
+
+      temp->copy(*this);  // copy current array to temp
+      this->copy(&other); // copy other to current array
+      other->copy(&temp); // copy temp to other array
+      temp->free();       // free temp
+    }
+
+    // generalized using a lambda
+    // udf = []() { return (type_t)value;}
+    template<typename op_t, typename stream_t>
+    void fill(op_t udf,
+              location_t target == location_t::default,
+              stream_t stream = 0)
+    {
+      if (is_location_set(target, location_t::device) &&
+          is_allocated(location_t::device)) {
+        const int threads = 256;
+        const int blocks = 512;
+        cuda::launch(_for,
+                     cuda::launch_configuration_t(blocks, threads, 0, stream),
+                     this->d_pointer,
+                     udf,
+                     size);
+      }
+
+      if (is_location_set(target, location_t::host) &&
+          is_allocated(location_t::host)) {
+        for (_int_t i = 0; i < this->size; i++) {
+          h_pointer[i] = udf();
+        }
+      }
+    }
+
+    template<typename stream_t>
+    void fill(const type_t& value,
+              location_t target == location_t::default,
+              stream_t stream = 0)
+    {
+      if (is_location_set(target, location_t::device) &&
+          is_allocated(location_t::device)) {
+        const int threads = 256;
+        const int blocks = 512;
+        cuda::launch(_for,
+                     cuda::launch_configuration_t(blocks, threads, 0, stream),
+                     this->d_pointer,
+                     value,
+                     size);
+      }
+
+      if (is_location_set(target, location_t::host) &&
+          is_allocated(location_t::host)) {
+        for (_int_t i = 0; i < this->size; i++) {
+          h_pointer[i] = value;
+        }
+      }
+    }
 
   } // struct: array
 }

     */

    // synchronous copy
    copy(pointer_t source, pointer_t destination, size_t bytes)
    {
      // cuda-api-wrappers goes to-from, size.
      cuda::memory::copy(destination, source, bytes);

#pragma once

// includes: cuda-api-wrappers
#include <cuda/api_wrappers.hpp>

namespace gunrock {
namespace datastruct {
