Skip to content

Commit fd70d8d

Browse files
author
Petr Vesely
committed
[UR] clarify sampler spec and and CTS
1 parent a6083f5 commit fd70d8d

File tree

17 files changed

+368
-33
lines changed

17 files changed

+368
-33
lines changed

include/ur_api.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,9 +2289,6 @@ urSamplerRelease(
22892289
/// + `NULL == hSampler`
22902290
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
22912291
/// + `::UR_SAMPLER_INFO_FILTER_MODE < propName`
2292-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
2293-
/// + `NULL == pPropValue`
2294-
/// + `NULL == pPropSizeRet`
22952292
/// - ::UR_RESULT_ERROR_INVALID_SAMPLER
22962293
/// - ::UR_RESULT_ERROR_INVALID_VALUE
22972294
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
@@ -2301,8 +2298,9 @@ urSamplerGetInfo(
23012298
ur_sampler_handle_t hSampler, ///< [in] handle of the sampler object
23022299
ur_sampler_info_t propName, ///< [in] name of the sampler property to query
23032300
size_t propSize, ///< [in] size in bytes of the sampler property value provided
2304-
void *pPropValue, ///< [out][typename(propName, propSize)] value of the sampler property
2305-
size_t *pPropSizeRet ///< [out] size in bytes returned in sampler property value
2301+
void *pPropValue, ///< [out][typename(propName, propSize)][optional] value of the sampler
2302+
///< property
2303+
size_t *pPropSizeRet ///< [out][optional] size in bytes returned in sampler property value
23062304
);
23072305

23082306
///////////////////////////////////////////////////////////////////////////////

scripts/core/sampler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ params:
155155
desc: "[in] size in bytes of the sampler property value provided"
156156
- type: "void*"
157157
name: pPropValue
158-
desc: "[out][typename(propName, propSize)] value of the sampler property"
158+
desc: "[out][typename(propName, propSize)][optional] value of the sampler property"
159159
- type: "size_t*"
160160
name: pPropSizeRet
161-
desc: "[out] size in bytes returned in sampler property value"
161+
desc: "[out][optional] size in bytes returned in sampler property value"
162162
returns:
163163
- $X_RESULT_ERROR_INVALID_SAMPLER
164164
- $X_RESULT_ERROR_INVALID_VALUE

source/adapters/null/ur_nullddi.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,9 +1019,10 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo(
10191019
size_t
10201020
propSize, ///< [in] size in bytes of the sampler property value provided
10211021
void *
1022-
pPropValue, ///< [out][typename(propName, propSize)] value of the sampler property
1022+
pPropValue, ///< [out][typename(propName, propSize)][optional] value of the sampler
1023+
///< property
10231024
size_t *
1024-
pPropSizeRet ///< [out] size in bytes returned in sampler property value
1025+
pPropSizeRet ///< [out][optional] size in bytes returned in sampler property value
10251026
) try {
10261027
ur_result_t result = UR_RESULT_SUCCESS;
10271028

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,9 +1152,10 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo(
11521152
size_t
11531153
propSize, ///< [in] size in bytes of the sampler property value provided
11541154
void *
1155-
pPropValue, ///< [out][typename(propName, propSize)] value of the sampler property
1155+
pPropValue, ///< [out][typename(propName, propSize)][optional] value of the sampler
1156+
///< property
11561157
size_t *
1157-
pPropSizeRet ///< [out] size in bytes returned in sampler property value
1158+
pPropSizeRet ///< [out][optional] size in bytes returned in sampler property value
11581159
) {
11591160
auto pfnGetInfo = context.urDdiTable.Sampler.pfnGetInfo;
11601161

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,9 +1335,10 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo(
13351335
size_t
13361336
propSize, ///< [in] size in bytes of the sampler property value provided
13371337
void *
1338-
pPropValue, ///< [out][typename(propName, propSize)] value of the sampler property
1338+
pPropValue, ///< [out][typename(propName, propSize)][optional] value of the sampler
1339+
///< property
13391340
size_t *
1340-
pPropSizeRet ///< [out] size in bytes returned in sampler property value
1341+
pPropSizeRet ///< [out][optional] size in bytes returned in sampler property value
13411342
) {
13421343
auto pfnGetInfo = context.urDdiTable.Sampler.pfnGetInfo;
13431344

@@ -1350,14 +1351,6 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo(
13501351
return UR_RESULT_ERROR_INVALID_NULL_HANDLE;
13511352
}
13521353

1353-
if (NULL == pPropValue) {
1354-
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
1355-
}
1356-
1357-
if (NULL == pPropSizeRet) {
1358-
return UR_RESULT_ERROR_INVALID_NULL_POINTER;
1359-
}
1360-
13611354
if (UR_SAMPLER_INFO_FILTER_MODE < propName) {
13621355
return UR_RESULT_ERROR_INVALID_ENUMERATION;
13631356
}

source/loader/ur_ldrddi.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,9 +1366,10 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo(
13661366
size_t
13671367
propSize, ///< [in] size in bytes of the sampler property value provided
13681368
void *
1369-
pPropValue, ///< [out][typename(propName, propSize)] value of the sampler property
1369+
pPropValue, ///< [out][typename(propName, propSize)][optional] value of the sampler
1370+
///< property
13701371
size_t *
1371-
pPropSizeRet ///< [out] size in bytes returned in sampler property value
1372+
pPropSizeRet ///< [out][optional] size in bytes returned in sampler property value
13721373
) {
13731374
ur_result_t result = UR_RESULT_SUCCESS;
13741375

source/loader/ur_libapi.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,9 +1538,6 @@ ur_result_t UR_APICALL urSamplerRelease(
15381538
/// + `NULL == hSampler`
15391539
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
15401540
/// + `::UR_SAMPLER_INFO_FILTER_MODE < propName`
1541-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
1542-
/// + `NULL == pPropValue`
1543-
/// + `NULL == pPropSizeRet`
15441541
/// - ::UR_RESULT_ERROR_INVALID_SAMPLER
15451542
/// - ::UR_RESULT_ERROR_INVALID_VALUE
15461543
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
@@ -1551,9 +1548,10 @@ ur_result_t UR_APICALL urSamplerGetInfo(
15511548
size_t
15521549
propSize, ///< [in] size in bytes of the sampler property value provided
15531550
void *
1554-
pPropValue, ///< [out][typename(propName, propSize)] value of the sampler property
1551+
pPropValue, ///< [out][typename(propName, propSize)][optional] value of the sampler
1552+
///< property
15551553
size_t *
1556-
pPropSizeRet ///< [out] size in bytes returned in sampler property value
1554+
pPropSizeRet ///< [out][optional] size in bytes returned in sampler property value
15571555
) try {
15581556
auto pfnGetInfo = ur_lib::context->urDdiTable.Sampler.pfnGetInfo;
15591557
if (nullptr == pfnGetInfo) {

source/ur_api.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,9 +1277,6 @@ ur_result_t UR_APICALL urSamplerRelease(
12771277
/// + `NULL == hSampler`
12781278
/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
12791279
/// + `::UR_SAMPLER_INFO_FILTER_MODE < propName`
1280-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
1281-
/// + `NULL == pPropValue`
1282-
/// + `NULL == pPropSizeRet`
12831280
/// - ::UR_RESULT_ERROR_INVALID_SAMPLER
12841281
/// - ::UR_RESULT_ERROR_INVALID_VALUE
12851282
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
@@ -1290,9 +1287,10 @@ ur_result_t UR_APICALL urSamplerGetInfo(
12901287
size_t
12911288
propSize, ///< [in] size in bytes of the sampler property value provided
12921289
void *
1293-
pPropValue, ///< [out][typename(propName, propSize)] value of the sampler property
1290+
pPropValue, ///< [out][typename(propName, propSize)][optional] value of the sampler
1291+
///< property
12941292
size_t *
1295-
pPropSizeRet ///< [out] size in bytes returned in sampler property value
1293+
pPropSizeRet ///< [out][optional] size in bytes returned in sampler property value
12961294
) {
12971295
ur_result_t result = UR_RESULT_SUCCESS;
12981296
return result;

test/conformance/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ add_subdirectory(memory)
5050
add_subdirectory(usm)
5151
add_subdirectory(event)
5252
add_subdirectory(queue)
53+
add_subdirectory(sampler)
5354
add_subdirectory(enqueue)
5455

5556
if(DEFINED UR_DPCXX)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (C) 2023 Intel Corporation
2+
# SPDX-License-Identifier: MIT
3+
4+
add_conformance_test_with_devices_environment(sampler
5+
urSamplerCreate.cpp
6+
urSamplerCreateWithNativeHandle.cpp
7+
urSamplerGetInfo.cpp
8+
urSamplerGetNativeHandle.cpp
9+
urSamplerRelease.cpp
10+
urSamplerRetain.cpp
11+
)

0 commit comments

Comments
 (0)