CUDA program structure use CUDA API to query for compatible devices cudaError_t cudaGetDeviceProperties(cudaDevProp* prop, int dev) Example: int device=1; cudaDeviceProp props; cudaGetDeviceProperties(&props, device) allocate memory on the CUDA device cudaError_t cudaMalloc(void** devPtr, size_t size) Example: size_t E_bytes = N_pts * 3 * sizeof(std::complex<double>); HANDLE_ERROR(cudaMalloc((void**)&gpu_E, E_bytes)); copy data from main memory to the CUDA device cudaError_t cudaMemcpy(void* dest, const void* source, size_t size, cudaMemcpyKind type) Example: HANDLE_ERROR(cudaMemcpy((void*)gpu_F, (void*)F, F_bytes, cudaMemcpyHostToDevice));