@@ -241,41 +241,6 @@ static hsa_status_t get_agent_info(hsa_agent_t agent, void *data) {
241
241
return err;
242
242
}
243
243
244
- hsa_status_t get_fine_grained_region (hsa_region_t region, void *data) {
245
- hsa_region_segment_t segment;
246
- hsa_region_get_info (region, HSA_REGION_INFO_SEGMENT, &segment);
247
- if (segment != HSA_REGION_SEGMENT_GLOBAL) {
248
- return HSA_STATUS_SUCCESS;
249
- }
250
- hsa_region_global_flag_t flags;
251
- hsa_region_get_info (region, HSA_REGION_INFO_GLOBAL_FLAGS, &flags);
252
- if (flags & HSA_REGION_GLOBAL_FLAG_FINE_GRAINED) {
253
- hsa_region_t *ret = reinterpret_cast <hsa_region_t *>(data);
254
- *ret = region;
255
- return HSA_STATUS_INFO_BREAK;
256
- }
257
- return HSA_STATUS_SUCCESS;
258
- }
259
-
260
- /* Determines if a memory region can be used for kernarg allocations. */
261
- static hsa_status_t get_kernarg_memory_region (hsa_region_t region, void *data) {
262
- hsa_region_segment_t segment;
263
- hsa_region_get_info (region, HSA_REGION_INFO_SEGMENT, &segment);
264
- if (HSA_REGION_SEGMENT_GLOBAL != segment) {
265
- return HSA_STATUS_SUCCESS;
266
- }
267
-
268
- hsa_region_global_flag_t flags;
269
- hsa_region_get_info (region, HSA_REGION_INFO_GLOBAL_FLAGS, &flags);
270
- if (flags & HSA_REGION_GLOBAL_FLAG_KERNARG) {
271
- hsa_region_t *ret = reinterpret_cast <hsa_region_t *>(data);
272
- *ret = region;
273
- return HSA_STATUS_INFO_BREAK;
274
- }
275
-
276
- return HSA_STATUS_SUCCESS;
277
- }
278
-
279
244
static hsa_status_t init_compute_and_memory () {
280
245
hsa_status_t err;
281
246
@@ -394,38 +359,6 @@ static hsa_status_t init_compute_and_memory() {
394
359
DEBUG_PRINT (" \t Coarse Memories : %d\n " , coarse_memories_size);
395
360
proc_index++;
396
361
}
397
- proc_index = 0 ;
398
- hsa_region_t atl_cpu_kernarg_region;
399
- atl_cpu_kernarg_region.handle = (uint64_t )-1 ;
400
- if (cpu_procs.size () > 0 ) {
401
- err = hsa_agent_iterate_regions (
402
- cpu_procs[0 ].agent (), get_fine_grained_region, &atl_cpu_kernarg_region);
403
- if (err == HSA_STATUS_INFO_BREAK) {
404
- err = HSA_STATUS_SUCCESS;
405
- }
406
- err = (atl_cpu_kernarg_region.handle == (uint64_t )-1 ) ? HSA_STATUS_ERROR
407
- : HSA_STATUS_SUCCESS;
408
- if (err != HSA_STATUS_SUCCESS) {
409
- printf (" [%s:%d] %s failed: %s\n " , __FILE__, __LINE__,
410
- " Finding a CPU kernarg memory region handle" ,
411
- get_error_string (err));
412
- return err;
413
- }
414
- }
415
- hsa_region_t atl_gpu_kernarg_region;
416
- /* Find a memory region that supports kernel arguments. */
417
- atl_gpu_kernarg_region.handle = (uint64_t )-1 ;
418
- if (gpu_procs.size () > 0 ) {
419
- hsa_agent_iterate_regions (gpu_procs[0 ].agent (), get_kernarg_memory_region,
420
- &atl_gpu_kernarg_region);
421
- err = (atl_gpu_kernarg_region.handle == (uint64_t )-1 ) ? HSA_STATUS_ERROR
422
- : HSA_STATUS_SUCCESS;
423
- if (err != HSA_STATUS_SUCCESS) {
424
- printf (" [%s:%d] %s failed: %s\n " , __FILE__, __LINE__,
425
- " Finding a kernarg memory region" , get_error_string (err));
426
- return err;
427
- }
428
- }
429
362
if (num_procs > 0 )
430
363
return HSA_STATUS_SUCCESS;
431
364
else
0 commit comments