Skip to content

Commit

Permalink
#8282: change dtype int32_t to uint32_t
Browse files Browse the repository at this point in the history
  • Loading branch information
hschoi4448 committed Jun 3, 2024
1 parent 2cffe57 commit 4edfbe0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ void kernel_main() {
for (uint32_t h = 0; h < TILE_HEIGHT; h++) {
for (uint32_t w = 0; w < TILE_WIDTH; w++) {
uint32_t n = nt * TILE_HEIGHT + h;
int32_t c = ct * TILE_WIDTH + w;
uint32_t c = ct * TILE_WIDTH + w;

uint32_t target_tilized_idx = get_tilized_idx(0, h); // 0, n
int32_t target_val = target_l1_ptr[target_tilized_idx];

uint32_t tmp_weight_tilized_idx = get_tilized_idx(h, w); // n, c

if (target_val != ignore_index && target_val == c) {
if (target_val != ignore_index && target_val == static_cast<int32_t>(c)) {
#if defined(WEIGHT)
tmp_weight_l1_ptr[tmp_weight_tilized_idx] = fp32_dest_acc_cast(weight_l1_ptr[target_val]);
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ void kernel_main() {
uint32_t target_tilized_idx = get_tilized_idx(n % TILE_HEIGHT, w);
int32_t target_val = target_l1_ptr[target_tilized_idx];

int32_t c = ct * TILE_HEIGHT + h;
uint32_t c = ct * TILE_HEIGHT + h;
uint32_t tmp_weight_tilized_idx = get_tilized_idx(h, w);

if (target_val != ignore_index && target_val == c) {
if (target_val != ignore_index && target_val == static_cast<int32_t>(c)) {
#if defined(WEIGHT)
tmp_weight_l1_ptr[tmp_weight_tilized_idx] = fp32_dest_acc_cast(weight_l1_ptr[target_val]);
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void kernel_main() {
uint32_t inner = i % num_inner_tile;
uint32_t nc = i / num_inner_tile;
uint32_t n = nc / C;
int32_t c = static_cast<int32_t>(nc % C);
uint32_t c = nc % C;

cb_reserve_back(cb_target, onetile);
uint32_t l1_write_addr_target = get_write_ptr(cb_target);
Expand All @@ -120,7 +120,7 @@ void kernel_main() {
int32_t target_val = target_l1_ptr[idx];
FP32_DEST_ACC_FTYPE val;

if (target_val != ignore_index && target_val == c) {
if (target_val != ignore_index && target_val == static_cast<int32_t>(c)) {
#if defined(WEIGHT)
val = fp32_dest_acc_cast(weight_l1_ptr[target_val]);
#else
Expand Down

0 comments on commit 4edfbe0

Please sign in to comment.