OpenCL and Nvidia Performance Primitive (NPP) compatibility

Does anybody knows if NPP functions are compatible with OpenCL environment ? I tried to call NPP functions on OpenCL allocated buffers with no success (nppiThreshold_8u_AC4R returning NPP_CUDA_KERNEL_EXECUTION_ERROR). Unfortunately the error description is of no help…

Has anyone succeeded calling NPP on OpenCl buffer ? Or knows for sure the it is impossible?

Regards,

P-O

NPP is a CUDA runtime API library. Trying to pass data allocated with OpenCL to a NPP primitive does not work.

You can think of the NPP primitives as functions wrapped around CUDA kernels. All the primitives do is call CUDA kernels internally to perform their work. All of NPP is developed using public CUDA runtime toolkit and compiler. So it is OK to pass pointers allocated with cudaMalloc, i.e. an NPP user would not be forced to use the 2D allocators provided by NPP. But it’s not OK to pass pointers allocated with a different API like OpenCL.

But I thought OpenCL was also built on top of the CUDA runtime so aren’t the pointers supposed to match?

But I thought OpenCL was also built on top of the CUDA runtime so aren’t the pointers supposed to match?

What pointers do you speak of? You don’t pass pointers to OpenCL kernels, you pass memory object references. A memory object is different than the raw device pointer you get in CUDA.

AFAIK OpenCL is not built on top of CUDA. It’s built on top of some shared components but it’s not a wrapper around CUDA.

What pointers do you speak of? You don’t pass pointers to OpenCL kernels, you pass memory object references. A memory object is different than the raw device pointer you get in CUDA.

AFAIK OpenCL is not built on top of CUDA. It’s built on top of some shared components but it’s not a wrapper around CUDA.

True, the whole parameter passing is totally different, sorry, I have very basic knowledge of OCL.

The term CUDA is somewhat unclear for me in this case, does it describe the hardware architecture or does it also encompass the CUDA C language for kernels?

Also, Is there any documentation aimed at detailing the software/hardware interfaces betweeen CUDA and OpenCL? or else CUDA vs OCL internals.

True, the whole parameter passing is totally different, sorry, I have very basic knowledge of OCL.

The term CUDA is somewhat unclear for me in this case, does it describe the hardware architecture or does it also encompass the CUDA C language for kernels?

Also, Is there any documentation aimed at detailing the software/hardware interfaces betweeen CUDA and OpenCL? or else CUDA vs OCL internals.

NPP is supposed to be used along with CUDA (as far as I can tell the NPP and wrapping sample projects are not flexible for implemntation of any real app) this is quite common both in the samples and in the documentation and (despite the fact that is quite untidy) it seems bot half naturally implied and necessary.

P.S. Does anybody know how seriously NPP is going to be supported a[sup][/sup]nd whether there are any alternatives out there for GP[sup]2[/sup] Image Processing.

NPP is supposed to be used along with CUDA (as far as I can tell the NPP and wrapping sample projects are not flexible for implemntation of any real app) this is quite common both in the samples and in the documentation and (despite the fact that is quite untidy) it seems bot half naturally implied and necessary.

P.S. Does anybody know how seriously NPP is going to be supported a[sup][/sup]nd whether there are any alternatives out there for GP[sup]2[/sup] Image Processing.

CUDA is two APIs and a C/C++ derived programming language. At the driver level there is JIT assembler compilation support for a virtual machine assembler language which the CUDA toolchain emits. It doesn’t have anything in particularly to do with the GPU hardware (although obviously that is the target and some features of the APIs are very GPU hardware oriented).

There isn’t much evidence that any interface exists between CUDA and OpenCL. NVIDIAs OpenCL implementation replaces the CUDA APIs and JIT compilation model with a different, but functionally similar API and JIT compiler. It appears that all of the programmable shader APIs (including Direct3D and OpenGL) do the same thing - there is a common driver “backend” which emits low level hardware optimized code and implements GPU system calls, and different driver “front end” libraries which interface the various “hardware abstract” programming models to that hardware interface. All the internals are closed and undocumented, as far as I know.

CUDA is two APIs and a C/C++ derived programming language. At the driver level there is JIT assembler compilation support for a virtual machine assembler language which the CUDA toolchain emits. It doesn’t have anything in particularly to do with the GPU hardware (although obviously that is the target and some features of the APIs are very GPU hardware oriented).

There isn’t much evidence that any interface exists between CUDA and OpenCL. NVIDIAs OpenCL implementation replaces the CUDA APIs and JIT compilation model with a different, but functionally similar API and JIT compiler. It appears that all of the programmable shader APIs (including Direct3D and OpenGL) do the same thing - there is a common driver “backend” which emits low level hardware optimized code and implements GPU system calls, and different driver “front end” libraries which interface the various “hardware abstract” programming models to that hardware interface. All the internals are closed and undocumented, as far as I know.