From 2c48039d0e87ace2f527c447e8148e6585a4bec3 Mon Sep 17 00:00:00 2001 From: Chao Liu Date: Tue, 10 Aug 2021 22:15:23 +0000 Subject: [PATCH] fix kernel filename --- CMakeLists.txt | 7 +++- ...mplicit_gemm_v6r1_dlops_nchw_kcyx_nkhw.hpp | 2 +- .../src/conv_bwd_driver_offline.cpp | 40 ++----------------- .../src/conv_fwd_driver_offline.cpp | 2 +- host/host_tensor/src/device.cpp | 18 ++++----- 5 files changed, 20 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6581bae8b9..4ac8550082 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,12 @@ message(STATUS "Build with HIP ${hip_VERSION}") #find_path(HALF_INCLUDE_DIR half.hpp) message("HALF_INCLUDE_DIR: ${HALF_INCLUDE_DIR}") +# CMAKE_CXX_FLAGS +if(BUILD_DEV) + string(APPEND CMAKE_CXX_FLAGS " -Werror -Weverything") +endif() +message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") + ## tidy include(EnableCompilerWarnings) set(MIOPEN_TIDY_ERRORS ERRORS * -readability-inconsistent-declaration-parameter-name) @@ -50,7 +56,6 @@ if(CMAKE_CXX_COMPILER MATCHES ".*hcc" OR CMAKE_CXX_COMPILER MATCHES ".*clang\\+\ # Enable tidy on hip elseif(MIOPEN_BACKEND STREQUAL "HIP" OR MIOPEN_BACKEND STREQUAL "HIPNOGPU") set(MIOPEN_TIDY_ERRORS ALL) - endif() include(ClangTidy) diff --git a/host/driver_offline/include/device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw.hpp b/host/driver_offline/include/device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw.hpp index 9edbb811ca..37ea6f1b17 100644 --- a/host/driver_offline/include/device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw.hpp +++ b/host/driver_offline/include/device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw.hpp @@ -51,7 +51,7 @@ void device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw( const auto out_desc_n_k_ho_wo = make_dynamic_naive_tensor_descriptor_packed_v2(out_n_k_ho_wo_lengths); -#if 1 +#if 0 // [8, 1, 128, 1] * [8, 4, 32, 1] = [1, 128, 4, 32] for fp32 // cdata = 64, BlockSize = 256 constexpr index_t BlockSize = 256; diff --git a/host/driver_offline/src/conv_bwd_driver_offline.cpp b/host/driver_offline/src/conv_bwd_driver_offline.cpp index 828bbae2bd..34fa7eb3fa 100644 --- a/host/driver_offline/src/conv_bwd_driver_offline.cpp +++ b/host/driver_offline/src/conv_bwd_driver_offline.cpp @@ -115,15 +115,13 @@ int main(int argc, char* argv[]) #endif #if 0 - constexpr index_t in_vector_size = 1; using in_data_t = float; using acc_data_t = float; using out_data_t = float; #elif 1 - constexpr index_t in_vector_size = 1; - using in_data_t = half_t; - using acc_data_t = float; - using out_data_t = half_t; + using in_data_t = half_t; + using acc_data_t = float; + using out_data_t = half_t; #endif std::vector in_lengths_host(4), wei_lengths_host(4), out_lengths_host(4); @@ -213,38 +211,6 @@ int main(int argc, char* argv[]) wei.GenerateTensorValue(gen_wei, num_thread); } - auto f_make_for_device_nchw = [&]() { -#if USE_DYNAMIC_MODE - const auto in_lengths_dev = make_tuple(N, C, Hi, Wi); - const auto wei_lengths_dev = make_tuple(K, C, Y, X); - const auto out_lengths_dev = make_tuple(N, K, Ho, Wo); - const auto conv_strides_dev = make_tuple(conv_stride_h, conv_stride_w); - const auto conv_dilations_dev = make_tuple(conv_dilation_h, conv_dilation_w); - const auto in_left_pads_dev = make_tuple(in_left_pad_h, in_left_pad_w); - const auto in_right_pads_dev = make_tuple(in_right_pad_h, in_right_pad_w); -#else - const auto in_lengths_dev = - make_tuple(Number{}, Number{}, Number{}, Number{}); - const auto wei_lengths_dev = make_tuple(Number{}, Number{}, Number{}, Number{}); - const auto out_lengths_dev = - make_tuple(Number{}, Number{}, Number{}, Number{}); - const auto conv_strides_dev = make_tuple(Number{}, Number{}); - const auto conv_dilations_dev = - make_tuple(Number{}, Number{}); - const auto in_left_pads_dev = make_tuple(Number{}, Number{}); - const auto in_right_pads_dev = - make_tuple(Number{}, Number{}); -#endif - - return make_tuple(in_lengths_dev, - wei_lengths_dev, - out_lengths_dev, - conv_strides_dev, - conv_dilations_dev, - in_left_pads_dev, - in_right_pads_dev); - }; - auto f_make_for_device_nhwc = [&]() { #if USE_DYNAMIC_MODE const auto in_lengths_dev = make_tuple(N, Hi, Wi, C); diff --git a/host/driver_offline/src/conv_fwd_driver_offline.cpp b/host/driver_offline/src/conv_fwd_driver_offline.cpp index f88d1b831e..968501e947 100644 --- a/host/driver_offline/src/conv_fwd_driver_offline.cpp +++ b/host/driver_offline/src/conv_fwd_driver_offline.cpp @@ -22,7 +22,7 @@ #define USE_DYNAMIC_MODE 1 #define USE_CONV_FWD_V4R4_NCHW 0 #define USE_CONV_FWD_V4R4R2_NHWC 1 -#define USE_CONV_FWD_V6R1_NCHW 0 +#define USE_CONV_FWD_V6R1_NCHW 1 #define USE_CONV_FWD_V5R1_NCHW 0 #define USE_CONV_FWD_V4R4R2_XDL_NCHW 0 #define USE_CONV_FWD_V4R4R4_XDL_NHWC 0 diff --git a/host/host_tensor/src/device.cpp b/host/host_tensor/src/device.cpp index d0d74a4c2a..0d1b3d6883 100644 --- a/host/host_tensor/src/device.cpp +++ b/host/host_tensor/src/device.cpp @@ -24,32 +24,32 @@ struct KernelTimerImpl { KernelTimerImpl() { - hipEventCreate(&mStart); - hipEventCreate(&mEnd); + hipGetErrorString(hipEventCreate(&mStart)); + hipGetErrorString(hipEventCreate(&mEnd)); } ~KernelTimerImpl() { - hipEventDestroy(mStart); - hipEventDestroy(mEnd); + hipGetErrorString(hipEventDestroy(mStart)); + hipGetErrorString(hipEventDestroy(mEnd)); } void Start() { - hipDeviceSynchronize(); - hipEventRecord(mStart, 0); + hipGetErrorString(hipDeviceSynchronize()); + hipGetErrorString(hipEventRecord(mStart, nullptr)); } void End() { - hipEventRecord(mEnd, 0); - hipEventSynchronize(mEnd); + hipGetErrorString(hipEventRecord(mEnd, nullptr)); + hipGetErrorString(hipEventSynchronize(mEnd)); } float GetElapsedTime() const { float time; - hipEventElapsedTime(&time, mStart, mEnd); + hipGetErrorString(hipEventElapsedTime(&time, mStart, mEnd)); return time; }