Skip to content

Commit 0540ea2

Browse files
author
Ivan Karachun
committed
Address reviewers' comments
Signed-off-by: Ivan Karachun <ivan.karachun@intel.com>
1 parent 051e01b commit 0540ea2

File tree

4 files changed

+59
-59
lines changed

4 files changed

+59
-59
lines changed

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -160,28 +160,28 @@ const pi_bool PI_TRUE = CL_TRUE;
160160
const pi_bool PI_FALSE = CL_FALSE;
161161

162162
typedef enum {
163-
PI_SAMPLER_REFERENCE_COUNT = CL_SAMPLER_REFERENCE_COUNT,
164-
PI_SAMPLER_CONTEXT = CL_SAMPLER_CONTEXT,
165-
PI_SAMPLER_NORMALIZED_COORDS = CL_SAMPLER_NORMALIZED_COORDS,
166-
PI_SAMPLER_ADDRESSING_MODE = CL_SAMPLER_ADDRESSING_MODE,
167-
PI_SAMPLER_FILTER_MODE = CL_SAMPLER_FILTER_MODE,
168-
PI_SAMPLER_MIP_FILTER_MODE = CL_SAMPLER_MIP_FILTER_MODE,
169-
PI_SAMPLER_LOD_MIN = CL_SAMPLER_LOD_MIN,
170-
PI_SAMPLER_LOD_MAX = CL_SAMPLER_LOD_MAX
163+
PI_SAMPLER_INFO_REFERENCE_COUNT = CL_SAMPLER_REFERENCE_COUNT,
164+
PI_SAMPLER_INFO_CONTEXT = CL_SAMPLER_CONTEXT,
165+
PI_SAMPLER_INFO_NORMALIZED_COORDS = CL_SAMPLER_NORMALIZED_COORDS,
166+
PI_SAMPLER_INFO_ADDRESSING_MODE = CL_SAMPLER_ADDRESSING_MODE,
167+
PI_SAMPLER_INFO_FILTER_MODE = CL_SAMPLER_FILTER_MODE,
168+
PI_SAMPLER_INFO_MIP_FILTER_MODE = CL_SAMPLER_MIP_FILTER_MODE,
169+
PI_SAMPLER_INFO_LOD_MIN = CL_SAMPLER_LOD_MIN,
170+
PI_SAMPLER_INFO_LOD_MAX = CL_SAMPLER_LOD_MAX
171171
} _pi_sampler_info;
172172

173173
typedef enum {
174-
PI_ADDRESS_MIRRORED_REPEAT = CL_ADDRESS_MIRRORED_REPEAT,
175-
PI_ADDRESS_REPEAT = CL_ADDRESS_REPEAT,
176-
PI_ADDRESS_CLAMP_TO_EDGE = CL_ADDRESS_CLAMP_TO_EDGE,
177-
PI_ADDRESS_CLAMP = CL_ADDRESS_CLAMP,
178-
PI_ADDRESS_NONE = CL_ADDRESS_NONE
179-
} _pi_addressing_mode;
174+
PI_SAMPLER_ADDRESSING_MODE_MIRRORED_REPEAT = CL_ADDRESS_MIRRORED_REPEAT,
175+
PI_SAMPLER_ADDRESSING_MODE_REPEAT = CL_ADDRESS_REPEAT,
176+
PI_SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE = CL_ADDRESS_CLAMP_TO_EDGE,
177+
PI_SAMPLER_ADDRESSING_MODE_CLAMP = CL_ADDRESS_CLAMP,
178+
PI_SAMPLER_ADDRESSING_MODE_NONE = CL_ADDRESS_NONE
179+
} _pi_sampler_addressing_mode;
180180

181181
typedef enum {
182-
PI_FILTER_NEAREST = CL_FILTER_NEAREST,
183-
PI_FILTER_LINEAR = CL_FILTER_LINEAR,
184-
} _pi_filter_mode;
182+
PI_SAMPLER_FILTER_MODE_NEAREST = CL_FILTER_NEAREST,
183+
PI_SAMPLER_FILTER_MODE_LINEAR = CL_FILTER_LINEAR,
184+
} _pi_sampler_filter_mode;
185185

186186
// NOTE: this is made 64-bit to match the size of cl_mem_flags to
187187
// make the translation to OpenCL transparent.
@@ -215,8 +215,8 @@ typedef _pi_mem_type pi_mem_type;
215215
typedef _pi_image_channel_order pi_image_channel_order;
216216
typedef _pi_image_channel_type pi_image_channel_type;
217217
typedef _pi_buffer_create_type pi_buffer_create_type;
218-
typedef _pi_addressing_mode pi_addressing_mode;
219-
typedef _pi_filter_mode pi_filter_mode;
218+
typedef _pi_sampler_addressing_mode pi_sampler_addressing_mode;
219+
typedef _pi_sampler_filter_mode pi_sampler_filter_mode;
220220
typedef _pi_sampler_info pi_sampler_info;
221221

222222
// Opaque data type for compatibility with OpenMP.

sycl/include/CL/sycl/detail/pi.hpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,31 @@ namespace pi {
2929
// Check for manually selected BE at run-time.
3030
bool useBackend(Backend Backend);
3131

32-
using PiResult = ::pi_result;
33-
using PiPlatform = ::pi_platform;
34-
using PiDevice = ::pi_device;
35-
using PiDeviceType = ::pi_device_type;
36-
using PiDeviceInfo = ::pi_device_info;
37-
using PiDeviceBinaryType = ::pi_device_binary_type;
38-
using PiContext = ::pi_context;
39-
using PiProgram = ::pi_program;
40-
using PiKernel = ::pi_kernel;
41-
using PiQueue = ::pi_queue;
42-
using PiQueueProperties = ::pi_queue_properties;
43-
using PiMem = ::pi_mem;
44-
using PiMemFlags = ::pi_mem_flags;
45-
using PiEvent = ::pi_event;
46-
using PiSampler = ::pi_sampler;
47-
using PiSamplerInfo = ::pi_sampler_info;
48-
using PiSamplerProperties = ::pi_sampler_properties;
49-
using PiAddressingMode = ::pi_addressing_mode;
50-
using PiFilterMode = ::pi_filter_mode;
51-
using PiMemImageFormat = ::pi_image_format;
52-
using PiMemImageDesc = ::pi_image_desc;
53-
using PiMemImageInfo = ::pi_image_info;
54-
using PiMemObjectType = ::pi_mem_type;
55-
using PiMemImageChannelOrder = ::pi_image_channel_order;
56-
using PiMemImageChannelType = ::pi_image_channel_type;
32+
using PiResult = ::pi_result;
33+
using PiPlatform = ::pi_platform;
34+
using PiDevice = ::pi_device;
35+
using PiDeviceType = ::pi_device_type;
36+
using PiDeviceInfo = ::pi_device_info;
37+
using PiDeviceBinaryType = ::pi_device_binary_type;
38+
using PiContext = ::pi_context;
39+
using PiProgram = ::pi_program;
40+
using PiKernel = ::pi_kernel;
41+
using PiQueue = ::pi_queue;
42+
using PiQueueProperties = ::pi_queue_properties;
43+
using PiMem = ::pi_mem;
44+
using PiMemFlags = ::pi_mem_flags;
45+
using PiEvent = ::pi_event;
46+
using PiSampler = ::pi_sampler;
47+
using PiSamplerInfo = ::pi_sampler_info;
48+
using PiSamplerProperties = ::pi_sampler_properties;
49+
using PiSamplerAddressingMode = ::pi_sampler_addressing_mode;
50+
using PiSamplerFilterMode = ::pi_sampler_filter_mode;
51+
using PiMemImageFormat = ::pi_image_format;
52+
using PiMemImageDesc = ::pi_image_desc;
53+
using PiMemImageInfo = ::pi_image_info;
54+
using PiMemObjectType = ::pi_mem_type;
55+
using PiMemImageChannelOrder = ::pi_image_channel_order;
56+
using PiMemImageChannelType = ::pi_image_channel_type;
5757

5858
// Get a string representing a _pi_platform_info enum
5959
std::string platformInfoToString(pi_platform_info info);

sycl/source/detail/pi_opencl.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,18 @@ pi_result OCL(piSamplerCreate)(pi_context context,
217217
// Initialize properties according to OpenCL 2.1 spec.
218218
pi_result error_code;
219219
pi_bool normalizedCoords = PI_TRUE;
220-
pi_addressing_mode addressingMode = PI_ADDRESS_CLAMP;
221-
pi_filter_mode filterMode = PI_FILTER_NEAREST;
220+
pi_sampler_addressing_mode addressingMode = PI_SAMPLER_ADDRESSING_MODE_CLAMP;
221+
pi_sampler_filter_mode filterMode = PI_SAMPLER_FILTER_MODE_NEAREST;
222222

223223
// Unpack sampler properties
224224
for (std::size_t i = 0; sampler_properties && sampler_properties[i] != 0;
225225
++i) {
226-
if (sampler_properties[i] == PI_SAMPLER_NORMALIZED_COORDS) {
226+
if (sampler_properties[i] == PI_SAMPLER_INFO_NORMALIZED_COORDS) {
227227
normalizedCoords = (pi_bool)sampler_properties[++i];
228-
} else if (sampler_properties[i] == PI_SAMPLER_ADDRESSING_MODE) {
229-
addressingMode = (pi_addressing_mode)sampler_properties[++i];
230-
} else if (sampler_properties[i] == PI_SAMPLER_FILTER_MODE) {
231-
filterMode = (pi_filter_mode)sampler_properties[++i];
228+
} else if (sampler_properties[i] == PI_SAMPLER_INFO_ADDRESSING_MODE) {
229+
addressingMode = (pi_sampler_addressing_mode)sampler_properties[++i];
230+
} else if (sampler_properties[i] == PI_SAMPLER_INFO_FILTER_MODE) {
231+
filterMode = (pi_sampler_filter_mode)sampler_properties[++i];
232232
} else {
233233
PI_ASSERT(false, "Cannot recognize sampler property");
234234
}

sycl/source/detail/sampler_impl.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ sampler_impl::sampler_impl(cl_sampler clSampler, const context &syclContext) {
2424
RT::PiSampler Sampler = pi::cast<RT::PiSampler>(clSampler);
2525
m_contextToSampler[syclContext] = Sampler;
2626
PI_CALL(RT::piSamplerRetain(Sampler));
27-
PI_CALL(RT::piSamplerGetInfo(Sampler, PI_SAMPLER_NORMALIZED_COORDS,
27+
PI_CALL(RT::piSamplerGetInfo(Sampler, PI_SAMPLER_INFO_NORMALIZED_COORDS,
2828
sizeof(pi_bool), &m_CoordNormMode, nullptr));
29-
PI_CALL(RT::piSamplerGetInfo(Sampler, PI_SAMPLER_ADDRESSING_MODE,
30-
sizeof(pi_addressing_mode), &m_AddrMode,
29+
PI_CALL(RT::piSamplerGetInfo(Sampler, PI_SAMPLER_INFO_ADDRESSING_MODE,
30+
sizeof(pi_sampler_addressing_mode), &m_AddrMode,
3131
nullptr));
32-
PI_CALL(RT::piSamplerGetInfo(Sampler, PI_SAMPLER_FILTER_MODE,
33-
sizeof(pi_filter_mode), &m_FiltMode,
32+
PI_CALL(RT::piSamplerGetInfo(Sampler, PI_SAMPLER_INFO_FILTER_MODE,
33+
sizeof(pi_sampler_filter_mode), &m_FiltMode,
3434
nullptr));
3535
}
3636

@@ -46,11 +46,11 @@ RT::PiSampler sampler_impl::getOrCreateSampler(const context &Context) {
4646
return m_contextToSampler[Context];
4747

4848
const pi_sampler_properties sprops[] = {
49-
PI_SAMPLER_NORMALIZED_COORDS,
49+
PI_SAMPLER_INFO_NORMALIZED_COORDS,
5050
static_cast<pi_sampler_properties>(m_CoordNormMode),
51-
PI_SAMPLER_ADDRESSING_MODE,
51+
PI_SAMPLER_INFO_ADDRESSING_MODE,
5252
static_cast<pi_sampler_properties>(m_AddrMode),
53-
PI_SAMPLER_FILTER_MODE,
53+
PI_SAMPLER_INFO_FILTER_MODE,
5454
static_cast<pi_sampler_properties>(m_FiltMode),
5555
0};
5656

0 commit comments

Comments
 (0)