@@ -1288,17 +1288,8 @@ void acl_kernel_if_launch_kernel(acl_kernel_if *kern,
1288
1288
// Called when we receive a kernel status interrupt. Cycle through all of
1289
1289
// the running accelerators and check for updated status.
1290
1290
void acl_kernel_if_update_status (acl_kernel_if *kern) {
1291
- unsigned int k, i;
1292
- unsigned int csr;
1293
- int activation_id;
1294
- unsigned int printf_size;
1295
- uintptr_t segment, segment_pre_irq;
1296
1291
acl_assert_locked_or_sig ();
1297
1292
1298
- #ifdef TEST_PROFILING_HARDWARE
1299
- uint64_t data[10 ];
1300
- #endif
1301
-
1302
1293
#ifdef POLLING
1303
1294
ACL_KERNEL_IF_DEBUG_MSG_VERBOSE (kern, 10 , " :: Updating kernel status.\n " );
1304
1295
#else
@@ -1308,15 +1299,17 @@ void acl_kernel_if_update_status(acl_kernel_if *kern) {
1308
1299
// Get the state of kernel_cra address span extender segment prior to IRQ in
1309
1300
// hardware If IRQ is received in middle of segment change, segment value in
1310
1301
// cache and hardware could go out of sync
1311
- acl_kernel_if_read_32b (kern, OFFSET_KERNEL_CRA_SEGMENT,
1312
- (unsigned int *)&segment);
1302
+ {
1303
+ unsigned int segment;
1304
+ acl_kernel_if_read_32b (kern, OFFSET_KERNEL_CRA_SEGMENT, &segment);
1313
1305
1314
- // Zero upper 32-bits on 64-bit machines
1315
- kern->cur_segment = segment & 0xffffffff ;
1316
- segment_pre_irq = kern->cur_segment ;
1306
+ // Zero upper 32-bits on 64-bit machines
1307
+ kern->cur_segment = segment & 0xffffffff ;
1308
+ }
1309
+ const uintptr_t segment_pre_irq = kern->cur_segment ;
1317
1310
1318
1311
// Check which accelerators are done and update their status appropriately
1319
- for (k = 0 ; k < kern->num_accel ; ++k) {
1312
+ for (unsigned int k = 0 ; k < kern->num_accel ; ++k) {
1320
1313
int next_queue_back;
1321
1314
unsigned int finish_counter = 0 ;
1322
1315
@@ -1335,7 +1328,7 @@ void acl_kernel_if_update_status(acl_kernel_if *kern) {
1335
1328
}
1336
1329
1337
1330
// Read the accelerator's status register
1338
- csr = 0 ;
1331
+ unsigned int csr = 0 ;
1339
1332
acl_kernel_cra_read (kern, k, KERNEL_OFFSET_CSR, &csr);
1340
1333
1341
1334
// Ignore non-status bits.
@@ -1370,11 +1363,11 @@ void acl_kernel_if_update_status(acl_kernel_if *kern) {
1370
1363
ACL_KERNEL_READ_BIT (csr, KERNEL_CSR_PROFILE_TEMPORAL_STATUS) == 0 )
1371
1364
continue ;
1372
1365
1373
- activation_id = kern->accel_job_ids [k][next_queue_back];
1366
+ int activation_id = kern->accel_job_ids [k][next_queue_back];
1374
1367
1375
1368
// read the printf buffer size from the kernel cra, just after the
1376
1369
// kernel arguments
1377
- printf_size = 0 ;
1370
+ unsigned int printf_size = 0 ;
1378
1371
if (kern->accel_num_printfs [k] > 0 ) {
1379
1372
acl_kernel_cra_read (kern, k, KERNEL_OFFSET_PRINTF_BUFFER_SIZE,
1380
1373
&printf_size);
@@ -1451,7 +1444,7 @@ void acl_kernel_if_update_status(acl_kernel_if *kern) {
1451
1444
finish_counter);
1452
1445
}
1453
1446
1454
- for (i = 0 ; i < finish_counter; i++) {
1447
+ for (unsigned int i = 0 ; i < finish_counter; i++) {
1455
1448
activation_id = kern->accel_job_ids [k][next_queue_back];
1456
1449
1457
1450
// Tell the host library this job is done
@@ -1463,6 +1456,8 @@ void acl_kernel_if_update_status(acl_kernel_if *kern) {
1463
1456
ACL_KERNEL_IF_DEBUG_MSG (
1464
1457
kern, " :: testing profile hardware on accel_id=%u.\n " , k);
1465
1458
1459
+ uint64_t data[10 ];
1460
+
1466
1461
acl_hal_mmd_get_profile_data (kern->physical_device_id , k, data, 6 );
1467
1462
1468
1463
acl_hal_mmd_reset_profile_counters (kern->physical_device_id , k);
0 commit comments