Skip to content

Commit b33d041

Browse files
committed
Merge branch 'main' into config-red-zone-size
2 parents 4dac433 + 24f7d66 commit b33d041

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+785
-84
lines changed

include/ur_api.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3448,7 +3448,7 @@ urUSMHostAlloc(
34483448
ur_context_handle_t hContext, ///< [in] handle of the context object
34493449
const ur_usm_desc_t *pUSMDesc, ///< [in][optional] USM memory allocation descriptor
34503450
ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
3451-
size_t size, ///< [in] size in bytes of the USM memory object to be allocated
3451+
size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
34523452
void **ppMem ///< [out] pointer to USM host memory object
34533453
);
34543454

@@ -3496,7 +3496,7 @@ urUSMDeviceAlloc(
34963496
ur_device_handle_t hDevice, ///< [in] handle of the device object
34973497
const ur_usm_desc_t *pUSMDesc, ///< [in][optional] USM memory allocation descriptor
34983498
ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
3499-
size_t size, ///< [in] size in bytes of the USM memory object to be allocated
3499+
size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
35003500
void **ppMem ///< [out] pointer to USM device memory object
35013501
);
35023502

@@ -3545,7 +3545,7 @@ urUSMSharedAlloc(
35453545
ur_device_handle_t hDevice, ///< [in] handle of the device object
35463546
const ur_usm_desc_t *pUSMDesc, ///< [in][optional] Pointer to USM memory allocation descriptor.
35473547
ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
3548-
size_t size, ///< [in] size in bytes of the USM memory object to be allocated
3548+
size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated
35493549
void **ppMem ///< [out] pointer to USM shared memory object
35503550
);
35513551

@@ -4076,6 +4076,8 @@ typedef struct ur_program_properties_t {
40764076
///
40774077
/// @details
40784078
/// - The application may call this function from simultaneous threads.
4079+
/// - The adapter may (but is not required to) perform validation of the
4080+
/// provided module during this call.
40794081
///
40804082
/// @remarks
40814083
/// _Analogues_
@@ -4116,6 +4118,10 @@ urProgramCreateWithIL(
41164118
/// - Following a successful call to this entry point, `phProgram` will
41174119
/// contain a binary of type ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or
41184120
/// ::UR_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`.
4121+
/// - The device specified by `hDevice` must be device associated with
4122+
/// context.
4123+
/// - The adapter may (but is not required to) perform validation of the
4124+
/// provided module during this call.
41194125
///
41204126
/// @remarks
41214127
/// _Analogues_

scripts/core/program.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ analogue:
8989
- "**clCreateProgramWithIL**"
9090
details:
9191
- "The application may call this function from simultaneous threads."
92+
- "The adapter may (but is not required to) perform validation of the provided module during this call."
9293
params:
9394
- type: $x_context_handle_t
9495
name: hContext
@@ -128,6 +129,8 @@ analogue:
128129
details:
129130
- "The application may call this function from simultaneous threads."
130131
- "Following a successful call to this entry point, `phProgram` will contain a binary of type $X_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or $X_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`."
132+
- "The device specified by `hDevice` must be device associated with context."
133+
- "The adapter may (but is not required to) perform validation of the provided module during this call."
131134
params:
132135
- type: $x_context_handle_t
133136
name: hContext

scripts/core/usm.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ params:
248248
desc: "[in][optional] Pointer to a pool created using urUSMPoolCreate"
249249
- type: "size_t"
250250
name: size
251-
desc: "[in] size in bytes of the USM memory object to be allocated"
251+
desc: "[in] minimum size in bytes of the USM memory object to be allocated"
252252
- type: void**
253253
name: ppMem
254254
desc: "[out] pointer to USM host memory object"
@@ -293,7 +293,7 @@ params:
293293
desc: "[in][optional] Pointer to a pool created using urUSMPoolCreate"
294294
- type: "size_t"
295295
name: size
296-
desc: "[in] size in bytes of the USM memory object to be allocated"
296+
desc: "[in] minimum size in bytes of the USM memory object to be allocated"
297297
- type: void**
298298
name: ppMem
299299
desc: "[out] pointer to USM device memory object"
@@ -339,7 +339,7 @@ params:
339339
desc: "[in][optional] Pointer to a pool created using urUSMPoolCreate"
340340
- type: "size_t"
341341
name: size
342-
desc: "[in] size in bytes of the USM memory object to be allocated"
342+
desc: "[in] minimum size in bytes of the USM memory object to be allocated"
343343
- type: void**
344344
name: ppMem
345345
desc: "[out] pointer to USM shared memory object"

source/adapters/hip/program.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
368368
case UR_PROGRAM_INFO_NUM_DEVICES:
369369
return ReturnValue(1u);
370370
case UR_PROGRAM_INFO_DEVICES:
371-
return ReturnValue(hProgram->getDevice(), 1);
371+
return ReturnValue(&hProgram->getContext()->getDevices()[0], 1);
372372
case UR_PROGRAM_INFO_SOURCE:
373373
return ReturnValue(hProgram->Binary);
374374
case UR_PROGRAM_INFO_BINARY_SIZES:

source/adapters/native_cpu/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName,
5353
case UR_CONTEXT_INFO_DEVICES:
5454
return returnValue(hContext->_device);
5555
case UR_CONTEXT_INFO_REFERENCE_COUNT:
56-
return returnValue(nullptr);
56+
return returnValue(uint32_t{hContext->getReferenceCount()});
5757
case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT:
5858
return returnValue(true);
5959
case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT:

source/adapters/null/ur_nullddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc(
12681268
ur_usm_pool_handle_t
12691269
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
12701270
size_t
1271-
size, ///< [in] size in bytes of the USM memory object to be allocated
1271+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
12721272
void **ppMem ///< [out] pointer to USM host memory object
12731273
) try {
12741274
ur_result_t result = UR_RESULT_SUCCESS;
@@ -1296,7 +1296,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc(
12961296
ur_usm_pool_handle_t
12971297
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
12981298
size_t
1299-
size, ///< [in] size in bytes of the USM memory object to be allocated
1299+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
13001300
void **ppMem ///< [out] pointer to USM device memory object
13011301
) try {
13021302
ur_result_t result = UR_RESULT_SUCCESS;
@@ -1324,7 +1324,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc(
13241324
ur_usm_pool_handle_t
13251325
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
13261326
size_t
1327-
size, ///< [in] size in bytes of the USM memory object to be allocated
1327+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
13281328
void **ppMem ///< [out] pointer to USM shared memory object
13291329
) try {
13301330
ur_result_t result = UR_RESULT_SUCCESS;

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc(
13311331
ur_usm_pool_handle_t
13321332
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
13331333
size_t
1334-
size, ///< [in] size in bytes of the USM memory object to be allocated
1334+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
13351335
void **ppMem ///< [out] pointer to USM host memory object
13361336
) {
13371337
auto pfnHostAlloc = context.urDdiTable.USM.pfnHostAlloc;
@@ -1363,7 +1363,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc(
13631363
ur_usm_pool_handle_t
13641364
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
13651365
size_t
1366-
size, ///< [in] size in bytes of the USM memory object to be allocated
1366+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
13671367
void **ppMem ///< [out] pointer to USM device memory object
13681368
) {
13691369
auto pfnDeviceAlloc = context.urDdiTable.USM.pfnDeviceAlloc;
@@ -1396,7 +1396,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc(
13961396
ur_usm_pool_handle_t
13971397
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
13981398
size_t
1399-
size, ///< [in] size in bytes of the USM memory object to be allocated
1399+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
14001400
void **ppMem ///< [out] pointer to USM shared memory object
14011401
) {
14021402
auto pfnSharedAlloc = context.urDdiTable.USM.pfnSharedAlloc;

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc(
17681768
ur_usm_pool_handle_t
17691769
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
17701770
size_t
1771-
size, ///< [in] size in bytes of the USM memory object to be allocated
1771+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
17721772
void **ppMem ///< [out] pointer to USM host memory object
17731773
) {
17741774
auto pfnHostAlloc = context.urDdiTable.USM.pfnHostAlloc;
@@ -1825,7 +1825,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc(
18251825
ur_usm_pool_handle_t
18261826
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
18271827
size_t
1828-
size, ///< [in] size in bytes of the USM memory object to be allocated
1828+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
18291829
void **ppMem ///< [out] pointer to USM device memory object
18301830
) {
18311831
auto pfnDeviceAlloc = context.urDdiTable.USM.pfnDeviceAlloc;
@@ -1892,7 +1892,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc(
18921892
ur_usm_pool_handle_t
18931893
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
18941894
size_t
1895-
size, ///< [in] size in bytes of the USM memory object to be allocated
1895+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
18961896
void **ppMem ///< [out] pointer to USM shared memory object
18971897
) {
18981898
auto pfnSharedAlloc = context.urDdiTable.USM.pfnSharedAlloc;

source/loader/ur_ldrddi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc(
17121712
ur_usm_pool_handle_t
17131713
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
17141714
size_t
1715-
size, ///< [in] size in bytes of the USM memory object to be allocated
1715+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
17161716
void **ppMem ///< [out] pointer to USM host memory object
17171717
) {
17181718
ur_result_t result = UR_RESULT_SUCCESS;
@@ -1747,7 +1747,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc(
17471747
ur_usm_pool_handle_t
17481748
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
17491749
size_t
1750-
size, ///< [in] size in bytes of the USM memory object to be allocated
1750+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
17511751
void **ppMem ///< [out] pointer to USM device memory object
17521752
) {
17531753
ur_result_t result = UR_RESULT_SUCCESS;
@@ -1785,7 +1785,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc(
17851785
ur_usm_pool_handle_t
17861786
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
17871787
size_t
1788-
size, ///< [in] size in bytes of the USM memory object to be allocated
1788+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
17891789
void **ppMem ///< [out] pointer to USM shared memory object
17901790
) {
17911791
ur_result_t result = UR_RESULT_SUCCESS;

source/loader/ur_libapi.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ ur_result_t UR_APICALL urUSMHostAlloc(
22042204
ur_usm_pool_handle_t
22052205
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
22062206
size_t
2207-
size, ///< [in] size in bytes of the USM memory object to be allocated
2207+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
22082208
void **ppMem ///< [out] pointer to USM host memory object
22092209
) try {
22102210
auto pfnHostAlloc = ur_lib::context->urDdiTable.USM.pfnHostAlloc;
@@ -2263,7 +2263,7 @@ ur_result_t UR_APICALL urUSMDeviceAlloc(
22632263
ur_usm_pool_handle_t
22642264
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
22652265
size_t
2266-
size, ///< [in] size in bytes of the USM memory object to be allocated
2266+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
22672267
void **ppMem ///< [out] pointer to USM device memory object
22682268
) try {
22692269
auto pfnDeviceAlloc = ur_lib::context->urDdiTable.USM.pfnDeviceAlloc;
@@ -2323,7 +2323,7 @@ ur_result_t UR_APICALL urUSMSharedAlloc(
23232323
ur_usm_pool_handle_t
23242324
pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate
23252325
size_t
2326-
size, ///< [in] size in bytes of the USM memory object to be allocated
2326+
size, ///< [in] minimum size in bytes of the USM memory object to be allocated
23272327
void **ppMem ///< [out] pointer to USM shared memory object
23282328
) try {
23292329
auto pfnSharedAlloc = ur_lib::context->urDdiTable.USM.pfnSharedAlloc;
@@ -2890,6 +2890,8 @@ ur_result_t UR_APICALL urPhysicalMemRelease(
28902890
///
28912891
/// @details
28922892
/// - The application may call this function from simultaneous threads.
2893+
/// - The adapter may (but is not required to) perform validation of the
2894+
/// provided module during this call.
28932895
///
28942896
/// @remarks
28952897
/// _Analogues_
@@ -2940,6 +2942,10 @@ ur_result_t UR_APICALL urProgramCreateWithIL(
29402942
/// - Following a successful call to this entry point, `phProgram` will
29412943
/// contain a binary of type ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or
29422944
/// ::UR_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`.
2945+
/// - The device specified by `hDevice` must be device associated with
2946+
/// context.
2947+
/// - The adapter may (but is not required to) perform validation of the
2948+
/// provided module during this call.
29432949
///
29442950
/// @remarks
29452951
/// _Analogues_

0 commit comments

Comments
 (0)