Skip to content

Commit f3fdd84

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 7d864b6 commit f3fdd84

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
@@ -2941,20 +2941,6 @@ typedef enum ur_context_info_t {
29412941
/// [::ur_bool_t] to indicate if the ::urEnqueueUSMFill2D entrypoint is
29422942
/// supported.
29432943
UR_CONTEXT_INFO_USM_FILL2D_SUPPORT = 4,
2944-
/// [::ur_memory_order_capability_flags_t][optional-query] return a
2945-
/// bit-field of atomic memory order capabilities.
2946-
UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES = 5,
2947-
/// [::ur_memory_scope_capability_flags_t][optional-query] return a
2948-
/// bit-field of atomic memory scope capabilities.
2949-
UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES = 6,
2950-
/// [::ur_memory_order_capability_flags_t][optional-query] return a
2951-
/// bit-field of atomic memory fence order capabilities.
2952-
/// Zero is returned if the backend does not support context-level fences.
2953-
UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES = 7,
2954-
/// [::ur_memory_scope_capability_flags_t][optional-query] return a
2955-
/// bit-field of atomic memory fence scope capabilities.
2956-
/// Zero is returned if the backend does not support context-level fences.
2957-
UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES = 8,
29582944
/// @cond
29592945
UR_CONTEXT_INFO_FORCE_UINT32 = 0x7fffffff
29602946
/// @endcond
@@ -3003,7 +2989,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextRelease(
30032989
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
30042990
/// + `NULL == hContext`
30052991
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
3006-
/// + `::UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES < propName`
2992+
/// + `::UR_CONTEXT_INFO_USM_FILL2D_SUPPORT < propName`
30072993
/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
30082994
/// + If `propName` is not supported by the adapter.
30092995
/// - ::UR_RESULT_ERROR_INVALID_SIZE

include/ur_print.hpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5881,18 +5881,6 @@ inline std::ostream &operator<<(std::ostream &os,
58815881
case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT:
58825882
os << "UR_CONTEXT_INFO_USM_FILL2D_SUPPORT";
58835883
break;
5884-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES:
5885-
os << "UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES";
5886-
break;
5887-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES:
5888-
os << "UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES";
5889-
break;
5890-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES:
5891-
os << "UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES";
5892-
break;
5893-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES:
5894-
os << "UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES";
5895-
break;
58965884
default:
58975885
os << "unknown enumerator";
58985886
break;
@@ -5976,66 +5964,6 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr,
59765964

59775965
os << ")";
59785966
} break;
5979-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: {
5980-
const ur_memory_order_capability_flags_t *tptr =
5981-
(const ur_memory_order_capability_flags_t *)ptr;
5982-
if (sizeof(ur_memory_order_capability_flags_t) > size) {
5983-
os << "invalid size (is: " << size
5984-
<< ", expected: >=" << sizeof(ur_memory_order_capability_flags_t)
5985-
<< ")";
5986-
return UR_RESULT_ERROR_INVALID_SIZE;
5987-
}
5988-
os << (const void *)(tptr) << " (";
5989-
5990-
ur::details::printFlag<ur_memory_order_capability_flag_t>(os, *tptr);
5991-
5992-
os << ")";
5993-
} break;
5994-
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: {
5995-
const ur_memory_scope_capability_flags_t *tptr =
5996-
(const ur_memory_scope_capability_flags_t *)ptr;
5997-
if (sizeof(ur_memory_scope_capability_flags_t) > size) {
5998-
os << "invalid size (is: " << size
5999-
<< ", expected: >=" << sizeof(ur_memory_scope_capability_flags_t)
6000-
<< ")";
6001-
return UR_RESULT_ERROR_INVALID_SIZE;
6002-
}
6003-
os << (const void *)(tptr) << " (";
6004-
6005-
ur::details::printFlag<ur_memory_scope_capability_flag_t>(os, *tptr);
6006-
6007-
os << ")";
6008-
} break;
6009-
case UR_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES: {
6010-
const ur_memory_order_capability_flags_t *tptr =
6011-
(const ur_memory_order_capability_flags_t *)ptr;
6012-
if (sizeof(ur_memory_order_capability_flags_t) > size) {
6013-
os << "invalid size (is: " << size
6014-
<< ", expected: >=" << sizeof(ur_memory_order_capability_flags_t)
6015-
<< ")";
6016-
return UR_RESULT_ERROR_INVALID_SIZE;
6017-
}
6018-
os << (const void *)(tptr) << " (";
6019-
6020-
ur::details::printFlag<ur_memory_order_capability_flag_t>(os, *tptr);
6021-
6022-
os << ")";
6023-
} break;
6024-
case UR_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES: {
6025-
const ur_memory_scope_capability_flags_t *tptr =
6026-
(const ur_memory_scope_capability_flags_t *)ptr;
6027-
if (sizeof(ur_memory_scope_capability_flags_t) > size) {
6028-
os << "invalid size (is: " << size
6029-
<< ", expected: >=" << sizeof(ur_memory_scope_capability_flags_t)
6030-
<< ")";
6031-
return UR_RESULT_ERROR_INVALID_SIZE;
6032-
}
6033-
os << (const void *)(tptr) << " (";
6034-
6035-
ur::details::printFlag<ur_memory_scope_capability_flag_t>(os, *tptr);
6036-
6037-
os << ")";
6038-
} break;
60395967
default:
60405968
os << "unknown enumerator";
60415969
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)