Skip to content

Commit 6fb1716

Browse files
committed
switch to new error code convention
1 parent 7a0403f commit 6fb1716

1 file changed

Lines changed: 72 additions & 28 deletions

File tree

extensions/cl_khr_unified_svm.asciidoc

Lines changed: 72 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,27 @@ If _errcode_ret_ is `NULL` then no error code will be returned.
462462
{clSVMAllocWithPropertiesKHR} will return a valid non-`NULL` address and {CL_SUCCESS} will be returned in _errcode_ret_ if the shared virtual memory is allocated successfully.
463463
Otherwise, `NULL` will be returned, and _errcode_ret_ will be set to one of the following error values:
464464

465-
* {CL_INVALID_CONTEXT} if _context_ is not a valid context.
466-
* {CL_INVALID_PROPERTY} if a memory property name in _properties_ is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.
467-
* {CL_INVALID_OPERATION} if no devices in _context_ support the SVM type specified by _svm_type_index_, or if a device associated with the SVM allocation does not support the SVM type specified by _svm_type_index_.
468-
* {CL_INVALID_VALUE} if _svm_type_index_ is greater than the number of SVM types supported the devices in _context_.
469-
* {CL_INVALID_BUFFER_SIZE} if _size_ is zero or greater than {CL_DEVICE_MAX_MEM_ALLOC_SIZE} for any OpenCL device in _context_ that supports the specified SVM type, or if _size_ is greater than {CL_DEVICE_MAX_MEM_ALLOC_SIZE} for a device associated with the SVM allocation.
470-
TODO: update depending on the updated queries for available SVM sizes.
471-
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required by the OpenCL implementation on the device.
472-
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources required by the OpenCL implementation on the host.
465+
* {CL_INVALID_CONTEXT}
466+
** if _context_ is not a valid OpenCL context
467+
* {CL_INVALID_PROPERTY}
468+
** if a memory property name in _properties_ is not a supported property name
469+
** if the value specified for a supported property name is not valid
470+
** if the same property name is specified more than once
471+
* {CL_INVALID_OPERATION}
472+
** if no devices in _context_ support the SVM type specified by _svm_type_index_
473+
** if a device associated with the SVM allocation does not support the SVM type specified by _svm_type_index_
474+
* {CL_INVALID_VALUE}
475+
** if _svm_type_index_ is greater than the number of SVM types supported the devices in _context_
476+
* {CL_INVALID_BUFFER_SIZE}
477+
// TODO: update depending on the updated queries for available SVM sizes:
478+
** if _size_ is greater than {CL_DEVICE_MAX_MEM_ALLOC_SIZE} for any OpenCL device in _context_ that supports the specified SVM type
479+
** if _size_ is greater than {CL_DEVICE_MAX_MEM_ALLOC_SIZE} for a device associated with the SVM allocation
480+
* {CL_OUT_OF_RESOURCES}
481+
** if there is a failure to allocate resources required by the OpenCL
482+
implementation on the device
483+
* {CL_OUT_OF_HOST_MEMORY}
484+
** if there is a failure to allocate resources required by the OpenCL
485+
implementation on the host
473486

474487
TODO: Do we want to document any specific error conditions for invalid property values?
475488

@@ -542,12 +555,21 @@ If _ptr_ is `NULL` then no action occurs.
542555
{clSVMFreeWithPropertiesKHR} will return {CL_SUCCESS} if the function executes successfully.
543556
Otherwise, it returns one of the following errors:
544557

545-
* {CL_INVALID_CONTEXT} if _context_ is not a valid context.
546-
* {CL_INVALID_PROPERTY} if a memory property name in _properties_ is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.
547-
* {CL_INVALID_VALUE} if _flags_ contains an invalid SVM free flag.
548-
* {CL_INVALID_VALUE} if _ptr_ is not a value returned by {clSVMAlloc}, {clSVMAllocWithPropertiesKHR}, or a `NULL` pointer.
549-
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required by the OpenCL implementation on the device.
550-
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources required by the OpenCL implementation on the host.
558+
* {CL_INVALID_CONTEXT}
559+
** if _context_ is not a valid OpenCL context
560+
* {CL_INVALID_PROPERTY}
561+
** if a memory property name in _properties_ is not a supported property name
562+
** if the value specified for a supported property name is not valid
563+
** if the same property name is specified more than once
564+
* {CL_INVALID_VALUE}
565+
** if _flags_ contains an invalid SVM free flag
566+
** if _ptr_ is not a value returned by {clSVMAlloc}, {clSVMAllocWithPropertiesKHR}, or a `NULL` pointer
567+
* {CL_OUT_OF_RESOURCES}
568+
** if there is a failure to allocate resources required by the OpenCL
569+
implementation on the device
570+
* {CL_OUT_OF_HOST_MEMORY}
571+
** if there is a failure to allocate resources required by the OpenCL
572+
implementation on the host
551573

552574
[NOTE]
553575
====
@@ -588,12 +610,22 @@ If _param_value_size_ret_ is `NULL`, it is ignored.
588610
{clGetSVMPointerInfoKHR} returns {CL_SUCCESS} if the function is executed successfully.
589611
Otherwise, it will return one of the following error values:
590612

591-
* {CL_INVALID_CONTEXT} if _context_ is not a valid context.
592-
* {CL_INVALID_DEVICE} if _device_ is not a valid device or is not associated with _context_.
593-
* {CL_INVALID_VALUE} if _param_name_ is not a valid SVM allocation query.
594-
* {CL_INVALID_VALUE} if _param_value_ is not `NULL` and _param_value_size_ is smaller than the size of the query return type.
595-
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required by the OpenCL implementation on the device.
596-
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources required by the OpenCL implementation on the host.
613+
* {CL_INVALID_CONTEXT}
614+
** if _context_ is not a valid OpenCL context
615+
* {CL_INVALID_DEVICE}
616+
** if _device_ is not a valid device
617+
** if _device_ is not associated with _context_
618+
* {CL_INVALID_VALUE}
619+
** if _param_name_ is not one of the supported values
620+
** if the size in bytes specified by _param_value_size_ is less than the
621+
size of the return type specified in the <<svm-queries-table,SVM queries>>
622+
table and _param_value_ is not `NULL`
623+
* {CL_OUT_OF_RESOURCES}
624+
** if there is a failure to allocate resources required by the OpenCL
625+
implementation on the device
626+
* {CL_OUT_OF_HOST_MEMORY}
627+
** if there is a failure to allocate resources required by the OpenCL
628+
implementation on the host
597629

598630
[[svm-queries-table]]
599631
.List of supported param_names by clGetSVMPointerInfoKHR
@@ -680,14 +712,26 @@ The suggested SVM type may be {CL_UINT_MAX}, indicating that there is no SVM all
680712

681713
{clGetSVMSuggestedTypeIndexKHR} returns {CL_SUCCESS} if the query executed successfully. Otherwise, it returns one of the following errors:
682714

683-
* {CL_INVALID_CONTEXT} if _context_ is not a valid context.
684-
* {CL_INVALID_PROPERTY} if a memory property name in _properties_ is not a supported property name, if the value specified for a supported property name is not valid, or if the same property name is specified more than once.
685-
* {CL_INVALID_VALUE} if _required_capabilities_ or _desired_capabilities_ contains an invalid SVM capability.
686-
* {CL_INVALID_BUFFER_SIZE} if _size_ is greater than {CL_DEVICE_MAX_MEM_ALLOC_SIZE} for any OpenCL device in _context_ or if _size_ is greater than {CL_DEVICE_MAX_MEM_ALLOC_SIZE} for a device associated with the SVM allocation.
687-
TODO: update depending on the updated queries for available SVM sizes.
688-
* {CL_INVALID_VALUE} if _suggested_svm_type_index_ is `NULL`.
689-
* {CL_OUT_OF_RESOURCES} if there is a failure to allocate resources required by the OpenCL implementation on the device.
690-
* {CL_OUT_OF_HOST_MEMORY} if there is a failure to allocate resources required by the OpenCL implementation on the host.
715+
* {CL_INVALID_CONTEXT}
716+
** if _context_ is not a valid OpenCL context
717+
* {CL_INVALID_PROPERTY}
718+
** if a memory property name in _properties_ is not a supported property name
719+
** if the value specified for a supported property name is not valid
720+
** if the same property name is specified more than once
721+
* {CL_INVALID_VALUE}
722+
** if _required_capabilities_ contains an invalid SVM capability
723+
** if _desired_capabilities_ contains an invalid SVM capability
724+
** if _suggested_svm_type_index_ is `NULL`
725+
* {CL_INVALID_BUFFER_SIZE}
726+
// TODO: update depending on the updated queries for available SVM sizes:
727+
** if _size_ is greater than {CL_DEVICE_MAX_MEM_ALLOC_SIZE} for any OpenCL device in _context_ that supports the specified SVM type
728+
** if _size_ is greater than {CL_DEVICE_MAX_MEM_ALLOC_SIZE} for a device associated with the SVM allocation
729+
* {CL_OUT_OF_RESOURCES}
730+
** if there is a failure to allocate resources required by the OpenCL
731+
implementation on the device
732+
* {CL_OUT_OF_HOST_MEMORY}
733+
** if there is a failure to allocate resources required by the OpenCL
734+
implementation on the host
691735

692736
===== Using SVM with Kernels
693737

0 commit comments

Comments
 (0)