diff --git a/include/ur_api.h b/include/ur_api.h index 764391527f..0e954caa50 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -2941,20 +2941,6 @@ typedef enum ur_context_info_t { /// [::ur_bool_t] to indicate if the ::urEnqueueUSMFill2D entrypoint is /// supported. UR_CONTEXT_INFO_USM_FILL2D_SUPPORT = 4, - /// [::ur_memory_order_capability_flags_t][optional-query] return a - /// bit-field of atomic memory order capabilities. - UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES = 5, - /// [::ur_memory_scope_capability_flags_t][optional-query] return a - /// bit-field of atomic memory scope capabilities. - UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 6, - /// [::ur_memory_order_capability_flags_t][optional-query] return a - /// bit-field of atomic memory fence order capabilities. - /// Zero is returned if the backend does not support context-level fences. - UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES = 7, - /// [::ur_memory_scope_capability_flags_t][optional-query] return a - /// bit-field of atomic memory fence scope capabilities. - /// Zero is returned if the backend does not support context-level fences. - UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES = 8, /// @cond UR_CONTEXT_INFO_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -3003,7 +2989,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextRelease( /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES < propName` +/// + `::UR_CONTEXT_INFO_USM_FILL2D_SUPPORT < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/include/ur_print.hpp b/include/ur_print.hpp index 5c5f573477..61e9baba46 100644 --- a/include/ur_print.hpp +++ b/include/ur_print.hpp @@ -5881,18 +5881,6 @@ inline std::ostream &operator<<(std::ostream &os, case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT: os << "UR_CONTEXT_INFO_USM_FILL2D_SUPPORT"; break; - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: - os << "UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES"; - break; - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: - os << "UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES"; - break; - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: - os << "UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES"; - break; - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: - os << "UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES"; - break; default: os << "unknown enumerator"; break; @@ -5976,66 +5964,6 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, os << ")"; } break; - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: { - const ur_memory_order_capability_flags_t *tptr = - (const ur_memory_order_capability_flags_t *)ptr; - if (sizeof(ur_memory_order_capability_flags_t) > size) { - os << "invalid size (is: " << size - << ", expected: >=" << sizeof(ur_memory_order_capability_flags_t) - << ")"; - return UR_RESULT_ERROR_INVALID_SIZE; - } - os << (const void *)(tptr) << " ("; - - ur::details::printFlag(os, *tptr); - - os << ")"; - } break; - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: { - const ur_memory_scope_capability_flags_t *tptr = - (const ur_memory_scope_capability_flags_t *)ptr; - if (sizeof(ur_memory_scope_capability_flags_t) > size) { - os << "invalid size (is: " << size - << ", expected: >=" << sizeof(ur_memory_scope_capability_flags_t) - << ")"; - return UR_RESULT_ERROR_INVALID_SIZE; - } - os << (const void *)(tptr) << " ("; - - ur::details::printFlag(os, *tptr); - - os << ")"; - } break; - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: { - const ur_memory_order_capability_flags_t *tptr = - (const ur_memory_order_capability_flags_t *)ptr; - if (sizeof(ur_memory_order_capability_flags_t) > size) { - os << "invalid size (is: " << size - << ", expected: >=" << sizeof(ur_memory_order_capability_flags_t) - << ")"; - return UR_RESULT_ERROR_INVALID_SIZE; - } - os << (const void *)(tptr) << " ("; - - ur::details::printFlag(os, *tptr); - - os << ")"; - } break; - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: { - const ur_memory_scope_capability_flags_t *tptr = - (const ur_memory_scope_capability_flags_t *)ptr; - if (sizeof(ur_memory_scope_capability_flags_t) > size) { - os << "invalid size (is: " << size - << ", expected: >=" << sizeof(ur_memory_scope_capability_flags_t) - << ")"; - return UR_RESULT_ERROR_INVALID_SIZE; - } - os << (const void *)(tptr) << " ("; - - ur::details::printFlag(os, *tptr); - - os << ")"; - } break; default: os << "unknown enumerator"; return UR_RESULT_ERROR_INVALID_ENUMERATION; diff --git a/scripts/core/context.yml b/scripts/core/context.yml index eb2324a56f..ec8071ba2f 100644 --- a/scripts/core/context.yml +++ b/scripts/core/context.yml @@ -101,18 +101,6 @@ etors: desc: "[$x_bool_t] to indicate if the $xEnqueueUSMMemcpy2D entrypoint is supported." - name: USM_FILL2D_SUPPORT desc: "[$x_bool_t] to indicate if the $xEnqueueUSMFill2D entrypoint is supported." - - name: ATOMIC_MEMORY_ORDER_CAPABILITIES - desc: "[$x_memory_order_capability_flags_t][optional-query] return a bit-field of atomic memory order capabilities." - - name: ATOMIC_MEMORY_SCOPE_CAPABILITIES - desc: "[$x_memory_scope_capability_flags_t][optional-query] return a bit-field of atomic memory scope capabilities." - - name: ATOMIC_FENCE_ORDER_CAPABILITIES - desc: | - [$x_memory_order_capability_flags_t][optional-query] return a bit-field of atomic memory fence order capabilities. - Zero is returned if the backend does not support context-level fences. - - name: ATOMIC_FENCE_SCOPE_CAPABILITIES - desc: | - [$x_memory_scope_capability_flags_t][optional-query] return a bit-field of atomic memory fence scope capabilities. - Zero is returned if the backend does not support context-level fences. --- #-------------------------------------------------------------------------- type: function desc: "Releases the context handle reference indicating end of its usage" diff --git a/source/adapters/cuda/context.cpp b/source/adapters/cuda/context.cpp index ffd991d59f..8d1adc900d 100644 --- a/source/adapters/cuda/context.cpp +++ b/source/adapters/cuda/context.cpp @@ -74,34 +74,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetInfo( hContext->getDevices().size()); case UR_CONTEXT_INFO_REFERENCE_COUNT: return ReturnValue(hContext->getReferenceCount()); - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: { - uint32_t Capabilities = UR_MEMORY_ORDER_CAPABILITY_FLAG_RELAXED | - UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE | - UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE | - UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL; - return ReturnValue(Capabilities); - } - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: { - int Major = 0; - UR_CHECK_ERROR(cuDeviceGetAttribute( - &Major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, - hContext->getDevices()[0]->get())); - uint32_t Capabilities = - (Major >= 7) ? UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_DEVICE | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_SYSTEM - : UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP | - UR_MEMORY_SCOPE_CAPABILITY_FLAG_DEVICE; - return ReturnValue(Capabilities); - } - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: { - return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; - } case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT: // 2D USM memcpy is supported. return ReturnValue(true); diff --git a/source/adapters/hip/context.cpp b/source/adapters/hip/context.cpp index b36ed73560..30bf4743a4 100644 --- a/source/adapters/hip/context.cpp +++ b/source/adapters/hip/context.cpp @@ -69,14 +69,6 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName, hContext->getDevices().size()); case UR_CONTEXT_INFO_REFERENCE_COUNT: return ReturnValue(hContext->getReferenceCount()); - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: { - // These queries should be dealt with in context_impl.cpp by calling the - // queries of each device separately and building the intersection set. - return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; - } case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT: // 2D USM memcpy is supported. return ReturnValue(true); diff --git a/source/adapters/level_zero/context.cpp b/source/adapters/level_zero/context.cpp index 67dcd513e5..094774c74a 100644 --- a/source/adapters/level_zero/context.cpp +++ b/source/adapters/level_zero/context.cpp @@ -120,21 +120,6 @@ ur_result_t urContextGetInfo( case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT: // 2D USM fill is not supported. return ReturnValue(uint8_t{false}); - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: { - - ur_memory_order_capability_flags_t Capabilities = - UR_MEMORY_ORDER_CAPABILITY_FLAG_RELAXED | - UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE | - UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE | - UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL | - UR_MEMORY_ORDER_CAPABILITY_FLAG_SEQ_CST; - return ReturnValue(Capabilities); - } - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: { - return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; - } default: // TODO: implement other parameters diff --git a/source/adapters/level_zero/v2/context.cpp b/source/adapters/level_zero/v2/context.cpp index cd4d8bfc9d..effc8fcc29 100644 --- a/source/adapters/level_zero/v2/context.cpp +++ b/source/adapters/level_zero/v2/context.cpp @@ -189,12 +189,6 @@ ur_result_t urContextGetInfo(ur_context_handle_t hContext, case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT: // 2D USM fill is not supported. return ReturnValue(uint8_t{false}); - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: { - return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; - } default: return UR_RESULT_ERROR_INVALID_ENUMERATION; } diff --git a/source/adapters/native_cpu/context.cpp b/source/adapters/native_cpu/context.cpp index 7c178f951a..d8adffe4b5 100644 --- a/source/adapters/native_cpu/context.cpp +++ b/source/adapters/native_cpu/context.cpp @@ -60,12 +60,6 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName, // case UR_CONTEXT_INFO_USM_MEMSET2D_SUPPORT: // 2D USM operations currently not supported. return returnValue(false); - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: { - return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; - } default: return UR_RESULT_ERROR_INVALID_ENUMERATION; } diff --git a/source/adapters/opencl/context.cpp b/source/adapters/opencl/context.cpp index 34181eda3b..4363c4dbb2 100644 --- a/source/adapters/opencl/context.cpp +++ b/source/adapters/opencl/context.cpp @@ -83,14 +83,6 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName, case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT: { return ReturnValue(false); } - case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: - case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: { - /* These queries should be dealt with in context_impl.cpp by calling the - * queries of each device separately and building the intersection set. */ - return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; - } case UR_CONTEXT_INFO_NUM_DEVICES: case UR_CONTEXT_INFO_DEVICES: case UR_CONTEXT_INFO_REFERENCE_COUNT: { diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 75603b3e89..5785775833 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -882,7 +882,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( if (pPropValue == NULL && pPropSizeRet == NULL) return UR_RESULT_ERROR_INVALID_NULL_POINTER; - if (UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES < propName) + if (UR_CONTEXT_INFO_USM_FILL2D_SUPPORT < propName) return UR_RESULT_ERROR_INVALID_ENUMERATION; if (propSize == 0 && pPropValue != NULL) diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index ca06bf670c..03f044fecf 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -1330,7 +1330,7 @@ ur_result_t UR_APICALL urContextRelease( /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES < propName` +/// + `::UR_CONTEXT_INFO_USM_FILL2D_SUPPORT < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 0afeaa7d26..0c10639cba 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -1183,7 +1183,7 @@ ur_result_t UR_APICALL urContextRelease( /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hContext` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES < propName` +/// + `::UR_CONTEXT_INFO_USM_FILL2D_SUPPORT < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/test/conformance/context/urContextGetInfo.cpp b/test/conformance/context/urContextGetInfo.cpp index 8b4d66a77f..11e702ddf5 100644 --- a/test/conformance/context/urContextGetInfo.cpp +++ b/test/conformance/context/urContextGetInfo.cpp @@ -77,74 +77,6 @@ TEST_P(urContextGetInfoTest, SuccessReferenceCount) { ASSERT_GT(reference_count, 0U); } -TEST_P(urContextGetInfoTest, SuccessAtomicMemoryOrderCapabilities) { - ur_context_info_t property_name = - UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES; - size_t property_size = 0; - - ASSERT_SUCCESS_OR_OPTIONAL_QUERY( - urContextGetInfo(context, property_name, 0, nullptr, &property_size), - property_name); - ASSERT_EQ(property_size, sizeof(ur_memory_order_capability_flags_t)); - - ur_memory_order_capability_flags_t flags = 0; - ASSERT_SUCCESS( - urContextGetInfo(context, property_name, property_size, &flags, nullptr)); - - ASSERT_EQ(flags & UR_MEMORY_ORDER_CAPABILITY_FLAGS_MASK, 0); -} - -TEST_P(urContextGetInfoTest, SuccessAtomicMemoryScopeCapabilities) { - ur_context_info_t property_name = - UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES; - size_t property_size = 0; - - ASSERT_SUCCESS_OR_OPTIONAL_QUERY( - urContextGetInfo(context, property_name, 0, nullptr, &property_size), - property_name); - ASSERT_EQ(property_size, sizeof(ur_memory_scope_capability_flags_t)); - - ur_memory_scope_capability_flags_t flags = 0; - ASSERT_SUCCESS( - urContextGetInfo(context, property_name, property_size, &flags, nullptr)); - - ASSERT_EQ(flags & UR_MEMORY_SCOPE_CAPABILITY_FLAGS_MASK, 0); -} - -TEST_P(urContextGetInfoTest, SuccessAtomicFenceOrderCapabilities) { - ur_context_info_t property_name = - UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES; - size_t property_size = 0; - - ASSERT_SUCCESS_OR_OPTIONAL_QUERY( - urContextGetInfo(context, property_name, 0, nullptr, &property_size), - property_name); - ASSERT_EQ(property_size, sizeof(ur_memory_order_capability_flags_t)); - - ur_memory_order_capability_flags_t flags = 0; - ASSERT_SUCCESS( - urContextGetInfo(context, property_name, property_size, &flags, nullptr)); - - ASSERT_EQ(flags & UR_MEMORY_ORDER_CAPABILITY_FLAGS_MASK, 0); -} - -TEST_P(urContextGetInfoTest, SuccessAtomicFenceScopeCapabilities) { - ur_context_info_t property_name = - UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES; - size_t property_size = 0; - - ASSERT_SUCCESS_OR_OPTIONAL_QUERY( - urContextGetInfo(context, property_name, 0, nullptr, &property_size), - property_name); - ASSERT_EQ(property_size, sizeof(ur_memory_scope_capability_flags_t)); - - ur_memory_scope_capability_flags_t flags = 0; - ASSERT_SUCCESS( - urContextGetInfo(context, property_name, property_size, &flags, nullptr)); - - ASSERT_EQ(flags & UR_MEMORY_SCOPE_CAPABILITY_FLAGS_MASK, 0); -} - TEST_P(urContextGetInfoTest, InvalidNullHandleContext) { uint32_t nDevices = 0; ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE, diff --git a/test/conformance/testing/include/uur/optional_queries.h b/test/conformance/testing/include/uur/optional_queries.h index d3f670545a..8ad7723b4a 100644 --- a/test/conformance/testing/include/uur/optional_queries.h +++ b/test/conformance/testing/include/uur/optional_queries.h @@ -50,19 +50,6 @@ template <> inline bool isQueryOptional(ur_device_info_t query) { query) != optional_ur_device_info_t.end(); } -constexpr std::array optional_ur_context_info_t = { - UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, - UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, - UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES, - UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES, -}; - -template <> inline bool isQueryOptional(ur_context_info_t query) { - return std::find(optional_ur_context_info_t.begin(), - optional_ur_context_info_t.end(), - query) != optional_ur_context_info_t.end(); -} - constexpr std::array optional_ur_usm_alloc_info_t = { UR_USM_ALLOC_INFO_POOL, };