Using Thrust with data which is allocated from the driver API (PTX)

Is it possible to use thrust with device data, which is allocated with the driver API ?

I have some arrays on the GPU, allocated with the driver API I want to sort … using custom compare function.
I am loading my source from a PTX file.

Is this possible ? Is there any example for stuff like that ?


I am bumping this because I have run into the same problem. I am using driver API and need to sort an array of uint64_t’s (CUdeviceptr), but this construct

thrust::device_ptr<uint64_t> ptr(somethingOfCudeviceptrType);

fails to compile. Is Thrust restricted only to runtime API, or is there another way to make it work under driver API?

Thrust expects runtime API constructs.

You can convert a CUdeviceptr to an ordinary pointer and use it with thrust, I believe.