Is __ constant memory access performance the same as __global memory on OpenCL

As I know. CUDA read-only memory is specific memory. And it is faster than global memory. But in OpenCL Spec. I get the following words.

The name __constant or constant address space is used to describe the variables allocated in the global memory and which are accessible inside the kernel (s) as read-only variables

So __constant memory is in __global memory. Does this mean that it has the same access performance with __global memory?

+3
source share
2 answers

It depends on the hardware and software architecture of the OpenCL platform used. For example, you can imagine an architecture with read-only caches that should not be involved in cache coherency. These caches can be used for read-only memory, but not for global memory. This way you can see faster access to read-only memory.

Speaking of which, none of the architectures I am familiar with works in this way. So just hypothetically.

+7
source

The OpenCL standard does not specify how read-only memory should be implemented, but NVIDIA graphics chips cache read-only memory. I do not know what AMD is doing.

+1
source

Source: https://habr.com/ru/post/1494706/


All Articles