/*WBL 14 March 2015 taken from http://nvlabs.github.io/nvbio/host_device_page.html */ /*compile with? Still no joy try stealing command line from qmap /usr/local/cuda/bin/nvcc host_device_page.cu -ccbin /opt/centos/devtoolset-1.1/root/usr/bin/cc -m64 -DPLATFORM_X86 -Xcompiler ,\"-Wall\",\"-Wno-unknown-pragmas\",\"-Wstrict-aliasing=0\",\"-fopenmp\",\"-O3\",\"-DNDEBUG\",\"-msse4.2\",\"-mpopcnt\",\"-funroll-loops\" --gpu-architecture=sm_35 -use_fast_math -DNVCC -I/usr/local/cuda/include -I../nvbio-master -I../nvbio-master/contrib -I../nvbio-master/build/contrib/zlib-1.2.7 -I../nvbio-master/contrib/crc -I../nvbio-master/contrib/bamtools -I../nvbio-master/contrib/moderngpu/include -I/usr/local/cuda/include */ //taken from hello_world.cu // #include #include #include #include #include #include using namespace nvbio; // however, this won't be possible in CUDA until UVM is finally available. With NVBIO, you'd do this instead: __global__ void my_kernel( // the CUDA kernel nvbio::vector_view vec) // NVBIO's surrogate of a reference { const uint32 tid = threadIdx.x + blockIdx.x * blockDim.x; // compute a linear thread id if (tid < vec.size()) vec[tid] = tid * 10; } int main() { nvbio::vector vec( 1000000 ); const uint32 blockdim = 128; const uint32 n_blocks = util::divide_ri( vec.size(), blockdim ); my_kernel<<>>( nvbio::plain_view( vec ) ); } // This basic pattern can be applied to all of NVBIO's data structures that are meant to be setup from the host and accessed from the device.