Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 54b776a

Browse files
authored
fix compile errors on Linux (#130)
* fix compile errors on Linux * remove warnings
1 parent 2d4d1b7 commit 54b776a

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

include/experimental/group/gemm/impl/int4_dequantize_xmx_xe.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ class gemm_t<compute_policy_int4_dequantize_xmx<compute_attr_,
530530
xetla_vector<uint8_t, block_size_x_b * block_size_y_b>
531531
zero_pt_blk;
532532
#pragma unroll
533-
for (int row = 0; row < block_size_y_b; row++) {
533+
for (uint32_t row = 0; row < block_size_y_b; row++) {
534534
zero_pt_blk
535535
.xetla_select<block_size_x_b, 1>(
536536
row * block_size_x_b)

include/subgroup/tile/impl/prefetch_xe.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ tile_prefetch(payload_t &payload) {
152152
= payload_t::arch_tag == gpu_arch::Xe ? 64 : 32;
153153
if constexpr (prefetch_len >= reg_in_bytes) {
154154
#pragma unroll
155-
for (int j = 0; j < prefetch_len / reg_in_bytes; j++) {
155+
for (uint32_t j = 0; j < prefetch_len / reg_in_bytes; j++) {
156156
uint32_t offset_x = j * reg_in_bytes * payload_t::scale_factor;
157157
uint32_t address_offset = offset_x * sizeof(dtype);
158158
xetla_prefetch_global<prefetch_dtype, reg_in_bytes,

tests/integration/data_transformer/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ static void data_transformer_run() {
8686
auto inputBundle
8787
= get_kernel_bundle<bundle_state::input>(context, kernelId);
8888
static const std::string env_set_str = "SYCL_PROGRAM_COMPILE_OPTIONS= -vc-codegen -Xfinalizer ' -printregusage -enableBCR -DPASTokenReduction '";
89-
putenv(env_set_str.c_str());
89+
putenv(const_cast<char*>(env_set_str.c_str()));
9090
kernel_bundle<bundle_state::executable> exeBundle = build(inputBundle);
9191
static const std::string env_unset_str = "SYCL_PROGRAM_COMPILE_OPTIONS=";
92-
putenv(env_unset_str.c_str());
92+
putenv(const_cast<char*>(env_unset_str.c_str()));
9393

9494
try {
9595
auto e_esimd = queue.submit([&](handler &cgh) {

tests/integration/gemm/bf16_stream_k/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void stream_k_gemm_run(uint32_t iter) {
301301

302302

303303
static const std::string env_set_str = "SYCL_PROGRAM_COMPILE_OPTIONS= -vc-codegen -doubleGRF -vc-disable-indvars-opt -Xfinalizer ' -printregusage -enableBCR -DPASTokenReduction '";
304-
putenv(env_set_str.c_str());
304+
putenv(const_cast<char*>(env_set_str.c_str()));
305305
//Define and initialize the data required for the calculation
306306
auto A = alloc_device_and_init<data_type_a>(
307307
size_a,
@@ -434,7 +434,7 @@ void stream_k_gemm_run(uint32_t iter) {
434434
}
435435

436436
static const std::string env_unset_str = "SYCL_PROGRAM_COMPILE_OPTIONS=";
437-
putenv(env_unset_str.c_str());
437+
putenv(const_cast<char*>(env_unset_str.c_str()));
438438

439439
ASSERT_EQ(0,
440440
gemm_result_validate(A, B, C, Bias, matrix_m, matrix_k, matrix_n,

tests/integration/softmax/softmax_bwd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ void softmax_bwd_run() {
9797
context, kernelId);
9898

9999
static const std::string env_set_str = "SYCL_PROGRAM_COMPILE_OPTIONS= -vc-codegen -doubleGRF -Xfinalizer ' -printregusage -enableBCR -DPASTokenReduction '";
100-
putenv(env_set_str.c_str());
100+
putenv(const_cast<char*>(env_set_str.c_str()));
101101
sycl::kernel_bundle<sycl::bundle_state::executable> exeBundle
102102
= build(inputBundle);
103103
static const std::string env_del_str = "SYCL_PROGRAM_COMPILE_OPTIONS=";
104-
putenv(env_del_str.c_str());
104+
putenv(const_cast<char*>(env_del_str.c_str()));
105105
try {
106106

107107
auto e_softmax_bwd = queue.submit([&](sycl::handler &cgh) {

tests/integration/softmax/softmax_fwd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ void softmax_fwd_run() {
8383
auto inputBundle
8484
= get_kernel_bundle<bundle_state::input>(context, kernelId);
8585
static const std::string env_set_str = "SYCL_PROGRAM_COMPILE_OPTIONS= -vc-codegen -doubleGRF -Xfinalizer ' -printregusage -enableBCR -DPASTokenReduction '";
86-
putenv(env_set_str.c_str());
86+
putenv(const_cast<char*>(env_set_str.c_str()));
8787
kernel_bundle<bundle_state::executable> exeBundle = build(inputBundle);
8888
static const std::string env_del_str = "SYCL_PROGRAM_COMPILE_OPTIONS=";
89-
putenv(env_del_str.c_str());
89+
putenv(const_cast<char*>(env_del_str.c_str()));
9090
try {
9191

9292
auto e_softmax_fwd = queue.submit([&](handler &cgh) {

tests/unit/tile_load_store/kernel_func.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ struct tile_load_store_unaligned_2d_func {
128128
payload_store_t payload_store(mem_desc_c);
129129
tile_prefetch(payload_prefetch);
130130
tile_load(matA, payload_load);
131-
static const char vec_a[] = "after load %f %f %f %f\n";
131+
// static const char vec_a[] = "after load %f %f %f %f\n";
132132
// sycl::ext::oneapi::experimental::printf(vec_a, (matA.reg[0]), (matA.reg[1]), (matA.reg[2]), (matA.reg[3]));
133133
// sycl::ext::oneapi::experimental::printf(vec_a, (matA.reg[16]), (matA.reg[17]), (matA.reg[18]), (matA.reg[19]));
134134
matC.reg = matA.reg;
135135
tile_store(matC, payload_store);
136-
static const char vec_b[] = "%d %d %d %d\n";
136+
// static const char vec_b[] = "%d %d %d %d\n";
137137
// sycl::ext::oneapi::experimental::printf(vec_b, (matC.reg[0]), (matC.reg[1]), (matC.reg[2]), (matC.reg[3]));
138138
}
139139
};

tests/utils/execution.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ void gemm_exec(const std::string &compile_str, size_t batch = 1) {
9090
auto inputBundle
9191
= get_kernel_bundle<bundle_state::input>(context, kernelId);
9292
static const std::string env_set_str = "SYCL_PROGRAM_COMPILE_OPTIONS="+compile_str;
93-
putenv(env_set_str.c_str());
93+
putenv(const_cast<char*>(env_set_str.c_str()));
9494
kernel_bundle<bundle_state::executable> exeBundle = build(inputBundle);
9595
static const std::string env_unset_str = "SYCL_PROGRAM_COMPILE_OPTIONS=";
96-
putenv(env_unset_str.c_str());
96+
putenv(const_cast<char*>(env_unset_str.c_str()));
9797

9898
using namespace gpu::xetla::group;
9999
using namespace gpu::xetla::kernel;

0 commit comments

Comments
 (0)