Hi all, Marco,
We implemented our whole application based on the driver API. Now I was trying to allocate an array to which a surface can be bound using cuArrayCreate3D with the CUDA_ARRAY3D_DESCRIPTOR.flags set to CUDA_ARRAY3D_SURFACE_LDST. However this does not seem to be working (in contrary to the 4.2 reference manual, the JCuda-docu also says leave .flags @ 0)
So I wanted to mix some runtime api in there, to check if using JCuda.cudaMalloc3DArray(cudaArray, desc, extent, CUDA_ARRAY3D_SURFACE_LDST) might do the trick.
But how do I get my CUarray pointer to be a cudaArray?
From the reference guide:
The types CUarray and struct cudaArray represent the same data type and may be used interchangeably by casting
the two types between each other.
In order to use a CUarray in a CUDA Runtime API function which takes a struct cudaArray , it is necessary to
explicitly cast the CUarray to a struct cudaArray .
In order to use a struct cudaArray in a CUDA Driver API function which takes a CUarray, it is necessary to explicitly
cast the struct cudaArray to a CUarray .
So a constructor like CUarray(cudaArray a) might do the trick. However, it would be even better if the initial problem would be solved and we could have surface-bindable CUarray’s.
Thanks in advance Marco, as always: awesome work