@@ -101,14 +101,14 @@ CL_API_ENTRY void *CL_API_CALL clHostMemAllocINTEL(
101
101
// Iterate over properties.
102
102
// The end of the properties list is specified with a zero.
103
103
cl_mem_alloc_flags_intel alloc_flags = 0 ;
104
- cl_int mem_id = - 1 ;
104
+ std::optional<cl_uint> mem_id;
105
105
while (properties != NULL && *properties != 0 ) {
106
106
switch (*properties) {
107
107
case CL_MEM_ALLOC_FLAGS_INTEL: {
108
108
alloc_flags = *(properties + 1 );
109
109
} break ;
110
110
case CL_MEM_ALLOC_BUFFER_LOCATION_INTEL: {
111
- mem_id = (cl_int ) * (properties + 1 );
111
+ mem_id = (cl_uint ) * (properties + 1 );
112
112
} break ;
113
113
default : {
114
114
UNLOCK_BAIL_INFO (CL_INVALID_PROPERTY, context, " Invalid properties" );
@@ -145,9 +145,9 @@ CL_API_ENTRY void *CL_API_CALL clHostMemAllocINTEL(
145
145
146
146
if (acl_get_hal ()->host_alloc ) {
147
147
std::vector<mem_properties_t > mmd_properties;
148
- if (mem_id >= 0 ) {
148
+ if (mem_id) {
149
149
mmd_properties.push_back (AOCL_MMD_MEM_PROPERTIES_BUFFER_LOCATION);
150
- mmd_properties.push_back (mem_id);
150
+ mmd_properties.push_back (mem_id. value () );
151
151
}
152
152
mmd_properties.push_back (0 );
153
153
@@ -394,7 +394,7 @@ clSharedMemAllocINTEL(cl_context context, cl_device_id device,
394
394
// The end of the properties list is specified with a zero.
395
395
cl_mem_alloc_flags_intel alloc_flags = 0 ;
396
396
std::unordered_set<unsigned long long > seen_flags;
397
- cl_int mem_id = - 1 ;
397
+ std::optional<cl_uint> mem_id;
398
398
while (properties != NULL && *properties != 0 ) {
399
399
switch (*properties) {
400
400
case CL_MEM_ALLOC_FLAGS_INTEL: {
@@ -417,7 +417,7 @@ clSharedMemAllocINTEL(cl_context context, cl_device_id device,
417
417
UNLOCK_BAIL_INFO (CL_INVALID_PROPERTY, context,
418
418
" Property specified multiple times" );
419
419
}
420
- mem_id = (cl_int ) * (properties + 1 );
420
+ mem_id = (cl_uint ) * (properties + 1 );
421
421
} break ;
422
422
default : {
423
423
UNLOCK_BAIL_INFO (CL_INVALID_PROPERTY, context, " Invalid properties" );
@@ -428,9 +428,9 @@ clSharedMemAllocINTEL(cl_context context, cl_device_id device,
428
428
429
429
if (acl_get_hal ()->shared_alloc ) {
430
430
std::vector<mem_properties_t > mmd_properties;
431
- if (mem_id >= 0 ) {
431
+ if (mem_id) {
432
432
mmd_properties.push_back (AOCL_MMD_MEM_PROPERTIES_BUFFER_LOCATION);
433
- mmd_properties.push_back (mem_id);
433
+ mmd_properties.push_back (mem_id. value () );
434
434
}
435
435
mmd_properties.push_back (0 );
436
436
0 commit comments