Skip to content

Commit 54ddea0

Browse files
committed
PR comments
1 parent 0702e62 commit 54ddea0

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

sycl/include/CL/sycl/detail/pi.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,21 @@
4545
// 7.9 Added new context and ownership arguments to
4646
// piextMemCreateWithNativeHandle.
4747
// 8.10 Added new optional device argument to piextQueueCreateWithNativeHandle
48+
// 9.11 Use values of OpenCL enums directly, rather than including `<CL/cl.h>`;
49+
// NOTE that this results in a changed API for `piProgramGetBuildInfo`.
4850

49-
#define _PI_H_VERSION_MAJOR 8
50-
#define _PI_H_VERSION_MINOR 10
51+
#define _PI_H_VERSION_MAJOR 9
52+
#define _PI_H_VERSION_MINOR 11
5153

5254
#define _PI_STRING_HELPER(a) #a
5355
#define _PI_CONCAT(a, b) _PI_STRING_HELPER(a.b)
5456
#define _PI_H_VERSION_STRING \
5557
_PI_CONCAT(_PI_H_VERSION_MAJOR, _PI_H_VERSION_MINOR)
5658

57-
// TODO: we need a mapping of PI to OpenCL somewhere, and this can be done
58-
// elsewhere, e.g. in the pi_opencl, but constants/enums mapping is now
59-
// done here, for efficiency and simplicity.
59+
// NOTE: This file presents a maping of OpenCL to PI enums, constants and
60+
// typedefs. The general approach taken was to replace `CL_` prefix with `PI_`.
61+
// Please consider this when adding or modifying values, as the strinct value
62+
// match is required.
6063
#include <CL/sycl/detail/export.hpp>
6164

6265
#include <cstddef>

sycl/unittests/assert/assert.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,16 @@ static pi_result redefinedProgramGetBuildInfo(pi_program P, pi_device D,
376376
size_t ParamValueSize,
377377
void *ParamValue,
378378
size_t *ParamValueSizeRet) {
379-
if (CL_PROGRAM_BINARY_TYPE == ParamName) {
380-
static const cl_program_binary_type T = CL_PROGRAM_BINARY_TYPE_EXECUTABLE;
379+
if (PI_PROGRAM_BUILD_INFO_BINARY_TYPE == ParamName) {
380+
static const pi_program_binary_type T = PI_PROGRAM_BINARY_TYPE_EXECUTABLE;
381381
if (ParamValue)
382382
memcpy(ParamValue, &T, sizeof(T));
383383
if (ParamValueSizeRet)
384384
*ParamValueSizeRet = sizeof(T);
385385
return PI_SUCCESS;
386386
}
387387

388-
if (CL_PROGRAM_BUILD_OPTIONS == ParamName) {
388+
if (PI_PROGRAM_BUILD_INFO_OPTIONS == ParamName) {
389389
if (ParamValueSizeRet)
390390
*ParamValueSizeRet = 0;
391391
return PI_SUCCESS;

0 commit comments

Comments
 (0)