Skip to content

Commit 855a4d1

Browse files
committed
Remove CONTEXT_INFO_ATOMIC queries.
These were used as dummy values in the sycl runtime to implement meta-queries for each device in the given context. The affiliated LLVM change for this PR updates that to use __SYCL_TRAIT_HANDLED_IN_RT instead. Fixes #2119
1 parent 75eb585 commit 855a4d1

File tree

14 files changed

+4
-254
lines changed

14 files changed

+4
-254
lines changed

include/ur_api.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,20 +2949,6 @@ typedef enum ur_context_info_t {
29492949
/// [::ur_bool_t] to indicate if the ::urEnqueueUSMFill2D entrypoint is
29502950
/// supported.
29512951
UR_CONTEXT_INFO_USM_FILL2D_SUPPORT = 4,
2952-
/// [::ur_memory_order_capability_flags_t][optional-query] return a
2953-
/// bit-field of atomic memory order capabilities.
2954-
UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES = 5,
2955-
/// [::ur_memory_scope_capability_flags_t][optional-query] return a
2956-
/// bit-field of atomic memory scope capabilities.
2957-
UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 6,
2958-
/// [::ur_memory_order_capability_flags_t][optional-query] return a
2959-
/// bit-field of atomic memory fence order capabilities.
2960-
/// Zero is returned if the backend does not support context-level fences.
2961-
UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES = 7,
2962-
/// [::ur_memory_scope_capability_flags_t][optional-query] return a
2963-
/// bit-field of atomic memory fence scope capabilities.
2964-
/// Zero is returned if the backend does not support context-level fences.
2965-
UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES = 8,
29662952
/// @cond
29672953
UR_CONTEXT_INFO_FORCE_UINT32 = 0x7fffffff
29682954
/// @endcond
@@ -3011,7 +2997,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextRelease(
30112997
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
30122998
/// + `NULL == hContext`
30132999
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
3014-
/// + `::UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES < propName`
3000+
/// + `::UR_CONTEXT_INFO_USM_FILL2D_SUPPORT < propName`
30153001
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
30163002
/// + If `propName` is not supported by the adapter.
30173003
/// - ::UR_RESULT_ERROR_INVALID_SIZE

include/ur_print.hpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5912,18 +5912,6 @@ inline std::ostream &operator<<(std::ostream &os,
59125912
case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT:
59135913
os << "UR_CONTEXT_INFO_USM_FILL2D_SUPPORT";
59145914
break;
5915-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES:
5916-
os << "UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES";
5917-
break;
5918-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES:
5919-
os << "UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES";
5920-
break;
5921-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES:
5922-
os << "UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES";
5923-
break;
5924-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES:
5925-
os << "UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES";
5926-
break;
59275915
default:
59285916
os << "unknown enumerator";
59295917
break;
@@ -6007,66 +5995,6 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr,
60075995

60085996
os << ")";
60095997
} break;
6010-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: {
6011-
const ur_memory_order_capability_flags_t *tptr =
6012-
(const ur_memory_order_capability_flags_t *)ptr;
6013-
if (sizeof(ur_memory_order_capability_flags_t) > size) {
6014-
os << "invalid size (is: " << size
6015-
<< ", expected: >=" << sizeof(ur_memory_order_capability_flags_t)
6016-
<< ")";
6017-
return UR_RESULT_ERROR_INVALID_SIZE;
6018-
}
6019-
os << (const void *)(tptr) << " (";
6020-
6021-
ur::details::printFlag<ur_memory_order_capability_flag_t>(os, *tptr);
6022-
6023-
os << ")";
6024-
} break;
6025-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: {
6026-
const ur_memory_scope_capability_flags_t *tptr =
6027-
(const ur_memory_scope_capability_flags_t *)ptr;
6028-
if (sizeof(ur_memory_scope_capability_flags_t) > size) {
6029-
os << "invalid size (is: " << size
6030-
<< ", expected: >=" << sizeof(ur_memory_scope_capability_flags_t)
6031-
<< ")";
6032-
return UR_RESULT_ERROR_INVALID_SIZE;
6033-
}
6034-
os << (const void *)(tptr) << " (";
6035-
6036-
ur::details::printFlag<ur_memory_scope_capability_flag_t>(os, *tptr);
6037-
6038-
os << ")";
6039-
} break;
6040-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: {
6041-
const ur_memory_order_capability_flags_t *tptr =
6042-
(const ur_memory_order_capability_flags_t *)ptr;
6043-
if (sizeof(ur_memory_order_capability_flags_t) > size) {
6044-
os << "invalid size (is: " << size
6045-
<< ", expected: >=" << sizeof(ur_memory_order_capability_flags_t)
6046-
<< ")";
6047-
return UR_RESULT_ERROR_INVALID_SIZE;
6048-
}
6049-
os << (const void *)(tptr) << " (";
6050-
6051-
ur::details::printFlag<ur_memory_order_capability_flag_t>(os, *tptr);
6052-
6053-
os << ")";
6054-
} break;
6055-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
6056-
const ur_memory_scope_capability_flags_t *tptr =
6057-
(const ur_memory_scope_capability_flags_t *)ptr;
6058-
if (sizeof(ur_memory_scope_capability_flags_t) > size) {
6059-
os << "invalid size (is: " << size
6060-
<< ", expected: >=" << sizeof(ur_memory_scope_capability_flags_t)
6061-
<< ")";
6062-
return UR_RESULT_ERROR_INVALID_SIZE;
6063-
}
6064-
os << (const void *)(tptr) << " (";
6065-
6066-
ur::details::printFlag<ur_memory_scope_capability_flag_t>(os, *tptr);
6067-
6068-
os << ")";
6069-
} break;
60705998
default:
60715999
os << "unknown enumerator";
60726000
return UR_RESULT_ERROR_INVALID_ENUMERATION;

scripts/core/context.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,6 @@ etors:
101101
desc: "[$x_bool_t] to indicate if the $xEnqueueUSMMemcpy2D entrypoint is supported."
102102
- name: USM_FILL2D_SUPPORT
103103
desc: "[$x_bool_t] to indicate if the $xEnqueueUSMFill2D entrypoint is supported."
104-
- name: ATOMIC_MEMORY_ORDER_CAPABILITIES
105-
desc: "[$x_memory_order_capability_flags_t][optional-query] return a bit-field of atomic memory order capabilities."
106-
- name: ATOMIC_MEMORY_SCOPE_CAPABILITIES
107-
desc: "[$x_memory_scope_capability_flags_t][optional-query] return a bit-field of atomic memory scope capabilities."
108-
- name: ATOMIC_FENCE_ORDER_CAPABILITIES
109-
desc: |
110-
[$x_memory_order_capability_flags_t][optional-query] return a bit-field of atomic memory fence order capabilities.
111-
Zero is returned if the backend does not support context-level fences.
112-
- name: ATOMIC_FENCE_SCOPE_CAPABILITIES
113-
desc: |
114-
[$x_memory_scope_capability_flags_t][optional-query] return a bit-field of atomic memory fence scope capabilities.
115-
Zero is returned if the backend does not support context-level fences.
116104
--- #--------------------------------------------------------------------------
117105
type: function
118106
desc: "Releases the context handle reference indicating end of its usage"

source/adapters/cuda/context.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -74,34 +74,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetInfo(
7474
hContext->getDevices().size());
7575
case UR_CONTEXT_INFO_REFERENCE_COUNT:
7676
return ReturnValue(hContext->getReferenceCount());
77-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: {
78-
uint32_t Capabilities = UR_MEMORY_ORDER_CAPABILITY_FLAG_RELAXED |
79-
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE |
80-
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE |
81-
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL;
82-
return ReturnValue(Capabilities);
83-
}
84-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: {
85-
int Major = 0;
86-
UR_CHECK_ERROR(cuDeviceGetAttribute(
87-
&Major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR,
88-
hContext->getDevices()[0]->get()));
89-
uint32_t Capabilities =
90-
(Major >= 7) ? UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM |
91-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP |
92-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP |
93-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_DEVICE |
94-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_SYSTEM
95-
: UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_ITEM |
96-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_SUB_GROUP |
97-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_WORK_GROUP |
98-
UR_MEMORY_SCOPE_CAPABILITY_FLAG_DEVICE;
99-
return ReturnValue(Capabilities);
100-
}
101-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES:
102-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
103-
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
104-
}
10577
case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT:
10678
// 2D USM memcpy is supported.
10779
return ReturnValue(true);

source/adapters/hip/context.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,6 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName,
6969
hContext->getDevices().size());
7070
case UR_CONTEXT_INFO_REFERENCE_COUNT:
7171
return ReturnValue(hContext->getReferenceCount());
72-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES:
73-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES:
74-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES:
75-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
76-
// These queries should be dealt with in context_impl.cpp by calling the
77-
// queries of each device separately and building the intersection set.
78-
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
79-
}
8072
case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT:
8173
// 2D USM memcpy is supported.
8274
return ReturnValue(true);

source/adapters/level_zero/context.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,6 @@ ur_result_t urContextGetInfo(
120120
case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT:
121121
// 2D USM fill is not supported.
122122
return ReturnValue(uint8_t{false});
123-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: {
124-
125-
ur_memory_order_capability_flags_t Capabilities =
126-
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELAXED |
127-
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQUIRE |
128-
UR_MEMORY_ORDER_CAPABILITY_FLAG_RELEASE |
129-
UR_MEMORY_ORDER_CAPABILITY_FLAG_ACQ_REL |
130-
UR_MEMORY_ORDER_CAPABILITY_FLAG_SEQ_CST;
131-
return ReturnValue(Capabilities);
132-
}
133-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES:
134-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES:
135-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
136-
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
137-
}
138123

139124
default:
140125
// TODO: implement other parameters

source/adapters/level_zero/v2/context.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,6 @@ ur_result_t urContextGetInfo(ur_context_handle_t hContext,
189189
case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT:
190190
// 2D USM fill is not supported.
191191
return ReturnValue(uint8_t{false});
192-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES:
193-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES:
194-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES:
195-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
196-
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
197-
}
198192
default:
199193
return UR_RESULT_ERROR_INVALID_ENUMERATION;
200194
}

source/adapters/native_cpu/context.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName,
6060
// case UR_CONTEXT_INFO_USM_MEMSET2D_SUPPORT:
6161
// 2D USM operations currently not supported.
6262
return returnValue(false);
63-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES:
64-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES:
65-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES:
66-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
67-
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
68-
}
6963
default:
7064
return UR_RESULT_ERROR_INVALID_ENUMERATION;
7165
}

source/adapters/opencl/context.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName,
8383
case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT: {
8484
return ReturnValue(false);
8585
}
86-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES:
87-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES:
88-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES:
89-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
90-
/* These queries should be dealt with in context_impl.cpp by calling the
91-
* queries of each device separately and building the intersection set. */
92-
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
93-
}
9486
case UR_CONTEXT_INFO_NUM_DEVICES:
9587
case UR_CONTEXT_INFO_DEVICES:
9688
case UR_CONTEXT_INFO_REFERENCE_COUNT: {

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo(
882882
if (pPropValue == NULL && pPropSizeRet == NULL)
883883
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
884884

885-
if (UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES < propName)
885+
if (UR_CONTEXT_INFO_USM_FILL2D_SUPPORT < propName)
886886
return UR_RESULT_ERROR_INVALID_ENUMERATION;
887887

888888
if (propSize == 0 && pPropValue != NULL)

0 commit comments

Comments
 (0)