Skip to content

Commit 2c48039

Browse files
author
Chao Liu
committed
fix kernel filename
1 parent d626dcc commit 2c48039

5 files changed

+20
-49
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ message(STATUS "Build with HIP ${hip_VERSION}")
4242
#find_path(HALF_INCLUDE_DIR half.hpp)
4343
message("HALF_INCLUDE_DIR: ${HALF_INCLUDE_DIR}")
4444

45+
# CMAKE_CXX_FLAGS
46+
if(BUILD_DEV)
47+
string(APPEND CMAKE_CXX_FLAGS " -Werror -Weverything")
48+
endif()
49+
message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
50+
4551
## tidy
4652
include(EnableCompilerWarnings)
4753
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\\+\
5056
# Enable tidy on hip
5157
elseif(MIOPEN_BACKEND STREQUAL "HIP" OR MIOPEN_BACKEND STREQUAL "HIPNOGPU")
5258
set(MIOPEN_TIDY_ERRORS ALL)
53-
5459
endif()
5560

5661
include(ClangTidy)

host/driver_offline/include/device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void device_dynamic_convolution_forward_implicit_gemm_v6r1_dlops_nchw_kcyx_nkhw(
5151
const auto out_desc_n_k_ho_wo =
5252
make_dynamic_naive_tensor_descriptor_packed_v2(out_n_k_ho_wo_lengths);
5353

54-
#if 1
54+
#if 0
5555
// [8, 1, 128, 1] * [8, 4, 32, 1] = [1, 128, 4, 32] for fp32
5656
// cdata = 64, BlockSize = 256
5757
constexpr index_t BlockSize = 256;

host/driver_offline/src/conv_bwd_driver_offline.cpp

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,13 @@ int main(int argc, char* argv[])
115115
#endif
116116

117117
#if 0
118-
constexpr index_t in_vector_size = 1;
119118
using in_data_t = float;
120119
using acc_data_t = float;
121120
using out_data_t = float;
122121
#elif 1
123-
constexpr index_t in_vector_size = 1;
124-
using in_data_t = half_t;
125-
using acc_data_t = float;
126-
using out_data_t = half_t;
122+
using in_data_t = half_t;
123+
using acc_data_t = float;
124+
using out_data_t = half_t;
127125
#endif
128126

129127
std::vector<std::size_t> in_lengths_host(4), wei_lengths_host(4), out_lengths_host(4);
@@ -213,38 +211,6 @@ int main(int argc, char* argv[])
213211
wei.GenerateTensorValue(gen_wei, num_thread);
214212
}
215213

216-
auto f_make_for_device_nchw = [&]() {
217-
#if USE_DYNAMIC_MODE
218-
const auto in_lengths_dev = make_tuple(N, C, Hi, Wi);
219-
const auto wei_lengths_dev = make_tuple(K, C, Y, X);
220-
const auto out_lengths_dev = make_tuple(N, K, Ho, Wo);
221-
const auto conv_strides_dev = make_tuple(conv_stride_h, conv_stride_w);
222-
const auto conv_dilations_dev = make_tuple(conv_dilation_h, conv_dilation_w);
223-
const auto in_left_pads_dev = make_tuple(in_left_pad_h, in_left_pad_w);
224-
const auto in_right_pads_dev = make_tuple(in_right_pad_h, in_right_pad_w);
225-
#else
226-
const auto in_lengths_dev =
227-
make_tuple(Number<N>{}, Number<C>{}, Number<Hi>{}, Number<Wi>{});
228-
const auto wei_lengths_dev = make_tuple(Number<K>{}, Number<C>{}, Number<Y>{}, Number<X>{});
229-
const auto out_lengths_dev =
230-
make_tuple(Number<N>{}, Number<K>{}, Number<Ho>{}, Number<Wo>{});
231-
const auto conv_strides_dev = make_tuple(Number<conv_stride_h>{}, Number<conv_stride_w>{});
232-
const auto conv_dilations_dev =
233-
make_tuple(Number<conv_dilation_h>{}, Number<conv_dilation_w>{});
234-
const auto in_left_pads_dev = make_tuple(Number<in_left_pad_h>{}, Number<in_left_pad_w>{});
235-
const auto in_right_pads_dev =
236-
make_tuple(Number<in_right_pad_h>{}, Number<in_right_pad_w>{});
237-
#endif
238-
239-
return make_tuple(in_lengths_dev,
240-
wei_lengths_dev,
241-
out_lengths_dev,
242-
conv_strides_dev,
243-
conv_dilations_dev,
244-
in_left_pads_dev,
245-
in_right_pads_dev);
246-
};
247-
248214
auto f_make_for_device_nhwc = [&]() {
249215
#if USE_DYNAMIC_MODE
250216
const auto in_lengths_dev = make_tuple(N, Hi, Wi, C);

host/driver_offline/src/conv_fwd_driver_offline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define USE_DYNAMIC_MODE 1
2323
#define USE_CONV_FWD_V4R4_NCHW 0
2424
#define USE_CONV_FWD_V4R4R2_NHWC 1
25-
#define USE_CONV_FWD_V6R1_NCHW 0
25+
#define USE_CONV_FWD_V6R1_NCHW 1
2626
#define USE_CONV_FWD_V5R1_NCHW 0
2727
#define USE_CONV_FWD_V4R4R2_XDL_NCHW 0
2828
#define USE_CONV_FWD_V4R4R4_XDL_NHWC 0

host/host_tensor/src/device.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,32 @@ struct KernelTimerImpl
2424
{
2525
KernelTimerImpl()
2626
{
27-
hipEventCreate(&mStart);
28-
hipEventCreate(&mEnd);
27+
hipGetErrorString(hipEventCreate(&mStart));
28+
hipGetErrorString(hipEventCreate(&mEnd));
2929
}
3030

3131
~KernelTimerImpl()
3232
{
33-
hipEventDestroy(mStart);
34-
hipEventDestroy(mEnd);
33+
hipGetErrorString(hipEventDestroy(mStart));
34+
hipGetErrorString(hipEventDestroy(mEnd));
3535
}
3636

3737
void Start()
3838
{
39-
hipDeviceSynchronize();
40-
hipEventRecord(mStart, 0);
39+
hipGetErrorString(hipDeviceSynchronize());
40+
hipGetErrorString(hipEventRecord(mStart, nullptr));
4141
}
4242

4343
void End()
4444
{
45-
hipEventRecord(mEnd, 0);
46-
hipEventSynchronize(mEnd);
45+
hipGetErrorString(hipEventRecord(mEnd, nullptr));
46+
hipGetErrorString(hipEventSynchronize(mEnd));
4747
}
4848

4949
float GetElapsedTime() const
5050
{
5151
float time;
52-
hipEventElapsedTime(&time, mStart, mEnd);
52+
hipGetErrorString(hipEventElapsedTime(&time, mStart, mEnd));
5353
return time;
5454
}
5555

0 commit comments

Comments
 (0)