问题
I used the CL_MEM_ALLOC_HOST_PTR
flag with my clCreateBuffer
calls, but the Compute Profiler shows all my "host mem transfer type" as being Pageable. I tried it in two different kernel setups, but the profiler wouldn't show that I was using pinned memory.
Is it just really random when a kernel gets to use pinned memory? Is it constrained by something? I am guessing the size of the buffer matters. I tried one buffer of a size of 10,000 floats and I still got Pageable memory. Let me know what you all think.
回答1:
If you check the OpenCL programming guide (3.1) it is mentioned in section 3.3.1 that OpenCL has now control over memory objects are allocated pinned or not. You can only TRY to create them using CL_MEM_ALLOC_HOST_PTR.
来源:https://stackoverflow.com/questions/3978699/pinned-memory-opencl-has-anybody-successfully-used-it