From 44a95f819dfa89f12cd31899c4482996452cdda7 Mon Sep 17 00:00:00 2001 From: Chen Fu <1316708+chenfucn@users.noreply.github.com> Date: Thu, 14 Mar 2024 18:13:19 +0000 Subject: [PATCH] strange compilation error --- cmake/onnxruntime_unittests.cmake | 7 +++++++ .../contrib_ops/cuda/quantization/matmul_nbits.cc | 2 +- onnxruntime/core/mickey/blk_q4/f16_gemm_sm80.h | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake index b004054c616a5..40ed0021f7f07 100644 --- a/cmake/onnxruntime_unittests.cmake +++ b/cmake/onnxruntime_unittests.cmake @@ -267,6 +267,13 @@ if(NOT onnxruntime_MINIMAL_BUILD AND NOT onnxruntime_REDUCED_OPS_BUILD) "${TEST_SRC_DIR}/optimizer/*.h" ) + if (MSVC AND ((onnxruntime_target_platform STREQUAL "ARM64") OR (onnxruntime_target_platform STREQUAL "ARM64EC"))) + set_source_files_properties("${TEST_SRC_DIR}/optimizer/graph_transform_test.cc" PROPERTIES COMPILE_FLAGS "/bigobj") + list(REMOVE_ITEM onnxruntime_test_optimizer_src + "${TEST_SRC_DIR}/optimizer/gpu_op_prepack_test.cc" + ) +endif() + set(onnxruntime_test_framework_src_patterns "${TEST_SRC_DIR}/framework/*.cc" "${TEST_SRC_DIR}/framework/*.h" diff --git a/onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.cc b/onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.cc index b8cfde96200b1..a29aaf460b7a6 100644 --- a/onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.cc +++ b/onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.cc @@ -66,7 +66,7 @@ Status MatMulNBits::ComputeInternal(OpKernelContext* ctx) const { "Internal Error: Prepacked gemm does not support zero points of type T. Fix the prepacking logic!"); return PrepackedGemm( static_cast(ctx->GetComputeStream()->GetHandle()), - helper.M(), a, b, scales, zero_points, Y); + static_cast(helper.M()), a, b, scales, zero_points, Y); } const auto* a_data = a->Data(); diff --git a/onnxruntime/core/mickey/blk_q4/f16_gemm_sm80.h b/onnxruntime/core/mickey/blk_q4/f16_gemm_sm80.h index 52bff7e40dbe3..66b54a2504475 100644 --- a/onnxruntime/core/mickey/blk_q4/f16_gemm_sm80.h +++ b/onnxruntime/core/mickey/blk_q4/f16_gemm_sm80.h @@ -11,9 +11,19 @@ #pragma once +// Ignore CUTLASS warning C4100: unreferenced formal parameter +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 4100) +#endif + #include "cutlass/cutlass.h" #include "cutlass_ext/q4gemm/device/quantb_gemm.h" +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + namespace onnxruntime { namespace cuda {