@@ -2773,7 +2773,7 @@ CL_API_ENTRY void *CL_API_CALL clEnqueueMapImageIntelFPGA(
2773
2773
image->mem_object_type == CL_MEM_OBJECT_IMAGE1D_BUFFER) {
2774
2774
if (image_slice_pitch == NULL ) {
2775
2775
BAIL_INFO (CL_INVALID_VALUE, command_queue->context ,
2776
- " Invalid slice pitch provided" );
2776
+ " Invalid slice pitch provided" );
2777
2777
}
2778
2778
*image_slice_pitch = 0 ;
2779
2779
} else if (image->mem_object_type == CL_MEM_OBJECT_IMAGE1D_ARRAY) {
@@ -2782,7 +2782,7 @@ CL_API_ENTRY void *CL_API_CALL clEnqueueMapImageIntelFPGA(
2782
2782
*image_slice_pitch =
2783
2783
image->fields .image_objs .image_desc ->image_height * tmp_row_pitch;
2784
2784
}
2785
-
2785
+
2786
2786
tmp_slice_pitch = *image_slice_pitch;
2787
2787
}
2788
2788
@@ -4065,7 +4065,7 @@ ACL_EXPORT CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemObjectsIntelFPGA(
4065
4065
cl_event local_event = 0 ;
4066
4066
unsigned int physical_id;
4067
4067
unsigned int mem_id;
4068
- int * needs_release_on_fail;
4068
+ std::vector< int > needs_release_on_fail;
4069
4069
4070
4070
std::scoped_lock lock{acl_mutex_wrapper};
4071
4071
@@ -4110,9 +4110,8 @@ ACL_EXPORT CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemObjectsIntelFPGA(
4110
4110
4111
4111
// Try to reserve space for all the buffers to be moved. If we fail, we need
4112
4112
// to know which buffers to deallocate:
4113
- needs_release_on_fail = (int *)malloc (sizeof (int ) * num_mem_objects);
4114
4113
for (i = 0 ; i < num_mem_objects; ++i) {
4115
- needs_release_on_fail[i] = 0 ;
4114
+ needs_release_on_fail. push_back ( 0 ) ;
4116
4115
}
4117
4116
4118
4117
status = CL_SUCCESS;
@@ -4144,7 +4143,6 @@ ACL_EXPORT CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemObjectsIntelFPGA(
4144
4143
}
4145
4144
mem_objects[i]->reserved_allocations_count [physical_id][mem_id]--;
4146
4145
}
4147
- free (needs_release_on_fail);
4148
4146
return status;
4149
4147
}
4150
4148
@@ -4155,7 +4153,6 @@ ACL_EXPORT CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemObjectsIntelFPGA(
4155
4153
CL_COMMAND_MIGRATE_MEM_OBJECTS, &local_event);
4156
4154
4157
4155
if (status != CL_SUCCESS) {
4158
- free (needs_release_on_fail);
4159
4156
return status; // already signalled callback
4160
4157
}
4161
4158
@@ -4201,8 +4198,6 @@ ACL_EXPORT CL_API_ENTRY cl_int CL_API_CALL clEnqueueMigrateMemObjectsIntelFPGA(
4201
4198
acl_idle_update (command_queue->context ); // Clean up early
4202
4199
}
4203
4200
4204
- free (needs_release_on_fail);
4205
-
4206
4201
return CL_SUCCESS;
4207
4202
}
4208
4203
@@ -6824,9 +6819,9 @@ static void acl_dump_mem_internal(cl_mem mem) {
6824
6819
? " is malloc"
6825
6820
: " not malloc" ));
6826
6821
printf (" .begin %p\n " ,
6827
- mem->block_allocation ->range .begin );
6822
+ mem->block_allocation ->range .begin );
6828
6823
printf (" .end %p\n " ,
6829
- mem->block_allocation ->range .next );
6824
+ mem->block_allocation ->range .next );
6830
6825
}
6831
6826
printf (" .mappings %d\n " , mem->mapping_count );
6832
6827
acl_print_debug_msg (" .size %lu\n " , mem->size );
0 commit comments