 	const cuda::array::dimensions_t<2> dims = {w, h};
 	cuda::array::array_t<float, 2> arr(device , dims);
 	auto ptr_in = cuda::memory::managed::make_unique<float[]>(arr.size());
-	ptr_in[0] = 1;
-	ptr_in[1] = 2;
-	ptr_in[3] = 3;
+	std::iota(ptr_in.get(), ptr_in.get() + arr.size(), 0);
 	auto ptr_out = cuda::memory::managed::make_unique<float[]>(arr.size());
 
 	std::cout << std::endl;

		tv.get(), ptr_out.get(), w, h, d);
	device.synchronize();
	for (size_t i = 0; i < arr.size(); ++i) {
		std::cout << "ptr_out[" << i << "] = " << ptr_out[i] << std::endl;
	}

	// copy between arrays and memory spaces
	cuda::array::array_t<float, 3> other_arr(device, dims);
	cuda::memory::copy(other_arr, ptr_out.get());
	cuda::memory::copy(ptr_in.get(), other_arr);

	// also asynchronously
	auto stream = device.create_stream(cuda::stream::async);

}

template<class Device>
void array_3d_example(Device& device, size_t w, size_t h, size_t d) {
	namespace grid = cuda::grid;

	const cuda::array::dimensions_t<3> dims = {w, h, d};
	cuda::array::array_t<float, 3> arr(device, dims);
	auto ptr_in = cuda::memory::managed::make_unique<float[]>(arr.size());
	std::iota(ptr_in.get(), ptr_in.get() + arr.size(), 0);
	auto ptr_out = cuda::memory::managed::make_unique<float[]>(arr.size());
	cuda::memory::copy(arr, ptr_in.get());
	cuda::texture_view tv(arr);
