Skip to content

Commit 5b51b98

Browse files
committed
Improve comment and style
1 parent a50bdbd commit 5b51b98

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

include/acl.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,16 @@ typedef enum {
515515
// Enum values here also need to match the SPIRV spec for device
516516
// global in the above link for acl_device_global_host_access_t.
517517

518-
519518
// Definition of device global.
520519
struct acl_device_global_mem_def_t {
521520
uint64_t address;
522521
uint32_t size;
523522
acl_device_global_host_access_t host_access;
524-
bool can_skip_programming; // every device global has the same value
523+
// every device global has the same value for can_skip_programming
524+
bool can_skip_programming;
525525
bool implement_in_csr;
526-
bool reset_on_reuse; // every device global has the same value
526+
// every device global has the same value for reset_on_reuse
527+
bool reset_on_reuse;
527528
};
528529

529530
// Part of acl_device_def_t where members are populated from the information

src/acl_auto_configure.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,8 @@ static bool read_device_global_mem_defs(
530530
}
531531
bool can_skip_programming = false;
532532
if (result && counters.back() > 0) {
533-
result =
534-
read_bool_counters(config_str, curr_pos, can_skip_programming, counters);
533+
result = read_bool_counters(config_str, curr_pos, can_skip_programming,
534+
counters);
535535
}
536536
bool implement_in_csr = false;
537537
if (result && counters.back() > 0) {
@@ -545,9 +545,12 @@ static bool read_device_global_mem_defs(
545545
}
546546

547547
acl_device_global_mem_def_t dev_global_def = {
548-
dev_global_addr, dev_global_size,
548+
dev_global_addr,
549+
dev_global_size,
549550
static_cast<acl_device_global_host_access_t>(host_access),
550-
can_skip_programming, implement_in_csr, reset_on_reuse};
551+
can_skip_programming,
552+
implement_in_csr,
553+
reset_on_reuse};
551554
bool ok =
552555
device_global_mem_defs.insert({device_global_name, dev_global_def})
553556
.second;

test/acl_auto_configure_test.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ TEST(auto_configure, simple) {
9999

100100
// Device global autodiscovery entries
101101
#define NUM_DEV_GLOBAL " 2"
102-
#define NUM_DEV_GLOBAL_FIELD " 7"
102+
#define NUM_DEV_GLOBAL_FIELD " 7"
103103
// The 7 fields are dev_globa_name, address, size, host_access,
104104
// can_skip_programming, implement_in_csr, reset_on_reuse
105105
#define DEV_GLOBAL_1 " kernel15_dev_global 0x1000 2048 3 0 0 0"
@@ -286,15 +286,13 @@ TEST(auto_configure, simple) {
286286
CHECK_EQUAL(2048, kernel15_dev_global->second.size);
287287
CHECK_EQUAL(ACL_DEVICE_GLOBAL_HOST_ACCESS_NONE,
288288
kernel15_dev_global->second.host_access);
289-
CHECK_EQUAL(false,
290-
kernel15_dev_global->second.can_skip_programming);
289+
CHECK_EQUAL(false, kernel15_dev_global->second.can_skip_programming);
291290
CHECK_EQUAL(false, kernel15_dev_global->second.implement_in_csr);
292291
CHECK_EQUAL(2048, kernel15_dev_global2->second.address);
293292
CHECK_EQUAL(1024, kernel15_dev_global2->second.size);
294293
CHECK_EQUAL(ACL_DEVICE_GLOBAL_HOST_ACCESS_WRITE_ONLY,
295294
kernel15_dev_global2->second.host_access);
296-
CHECK_EQUAL(false,
297-
kernel15_dev_global2->second.can_skip_programming);
295+
CHECK_EQUAL(false, kernel15_dev_global2->second.can_skip_programming);
298296
CHECK_EQUAL(true, kernel15_dev_global2->second.implement_in_csr);
299297

300298
// Check a second parsing.

0 commit comments

Comments
 (0)