0

Most OpenCL API calls return a status/error value, either directly or via an out-parameter (example: clCreateBuffer()). While that is not as informative as a long-form string description, it can tell us things like CL_OUT_OF_HOST_MEMORY, CL_MAP_FAILURE and such. However, the clSVMAlloc() API function returns a void *, and has no status out-parameter - while having multiple possible reasons for failure:

clSVMAlloc will fail if:

  • context is not a valid context, or no devices in context support SVM.

  • flags does not contain CL_MEM_SVM_FINE_GRAIN_BUFFER but does contain CL_MEM_SVM_ATOMICS.

  • Values specified in flags do not follow rules described for supported values in the SVM Memory Flags table.

  • CL_MEM_SVM_FINE_GRAIN_BUFFER or CL_MEM_SVM_ATOMICS is specified in flags and these are not supported by at least one device in context.

  • The values specified in flags are not valid, i.e. do not match those defined in the SVM Memory Flags table.

  • size is 0 or > CL_DEVICE_MAX_MEM_ALLOC_SIZE value for any device in context.

  • alignment is not a power of two or the OpenCL implementation cannot support the specified alignment for at least one device in context.

  • There was a failure to allocate resources.

so, is there a way I can determine which kind of failure occurred?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.