user1281071
user1281071

Reputation: 895

Copy 1D Array to CUDA Memory - pointer to memory

Q1: Is it possible to get pointer to device memory from cuda.lvlib:Copy 1D Array to CUDA Memory (SGL).vi? I would like to pass this pointer to my DLL.

Q2: DLL should return pointer to device memory where results are stored. Is it possible to use cuda.lvlib:Copy CUDA Memory to 1D Array (SGL).vi to copy resaults back to host?

Thanks.

Upvotes: 1

Views: 525

Answers (1)

ArchaeaSoftware
ArchaeaSoftware

Reputation: 4422

1D arrays generally exist outside the linear address space that CUDA uses to allocate device memory, so no, it should not be possible to query the pointer of a 1D CUDA array.

All versions of CUDA have been able to read/write the contents of 1D CUDA arrays via memcpy commands on the host, and kernels could read from them via texturing; with Fermi-class hardware on recent versions of CUDA, kernels also can read/write the contents of 1D CUDA arrays via surface references and 1D surface load/store intrinsics.

Upvotes: 2

Related Questions