Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel_ROCM
Commits
253f942b
Commit
253f942b
authored
Sep 22, 2023
by
Umang Yadav
Browse files
changes to make it compile
parent
8f9c0243
Changes
275
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
172 additions
and
0 deletions
+172
-0
include/ck/ck.hpp
include/ck/ck.hpp
+5
-0
include/ck/host_utility/device_prop.hpp
include/ck/host_utility/device_prop.hpp
+6
-0
include/ck/host_utility/hip_check_error.hpp
include/ck/host_utility/hip_check_error.hpp
+5
-0
include/ck/host_utility/io.hpp
include/ck/host_utility/io.hpp
+5
-0
include/ck/host_utility/kernel_launch.hpp
include/ck/host_utility/kernel_launch.hpp
+76
-0
include/ck/host_utility/stream_utility.hpp
include/ck/host_utility/stream_utility.hpp
+5
-0
include/ck/problem_transform/transform_forward_convolution3d_into_gemm_v4r4r4_ndhwc_kzyxc_ndhwk.hpp
...ward_convolution3d_into_gemm_v4r4r4_ndhwc_kzyxc_ndhwk.hpp
+5
-0
include/ck/stream_config.hpp
include/ck/stream_config.hpp
+5
-0
include/ck/tensor/static_tensor.hpp
include/ck/tensor/static_tensor.hpp
+5
-0
include/ck/tensor_description/cluster_descriptor.hpp
include/ck/tensor_description/cluster_descriptor.hpp
+5
-0
include/ck/tensor_description/multi_index_transform.hpp
include/ck/tensor_description/multi_index_transform.hpp
+5
-0
include/ck/tensor_description/multi_index_transform_helper.hpp
...de/ck/tensor_description/multi_index_transform_helper.hpp
+5
-0
include/ck/tensor_description/tensor_adaptor.hpp
include/ck/tensor_description/tensor_adaptor.hpp
+5
-0
include/ck/tensor_description/tensor_descriptor.hpp
include/ck/tensor_description/tensor_descriptor.hpp
+5
-0
include/ck/tensor_description/tensor_descriptor_helper.hpp
include/ck/tensor_description/tensor_descriptor_helper.hpp
+5
-0
include/ck/tensor_description/tensor_space_filling_curve.hpp
include/ck/tensor_description/tensor_space_filling_curve.hpp
+5
-0
include/ck/tensor_operation/gpu/block/blockwise_gemm_dl_v2r3.hpp
.../ck/tensor_operation/gpu/block/blockwise_gemm_dl_v2r3.hpp
+5
-0
include/ck/tensor_operation/gpu/block/blockwise_gemm_dlops_v2r2.hpp
.../tensor_operation/gpu/block/blockwise_gemm_dlops_v2r2.hpp
+5
-0
include/ck/tensor_operation/gpu/block/blockwise_gemm_dlops_v3.hpp
...ck/tensor_operation/gpu/block/blockwise_gemm_dlops_v3.hpp
+5
-0
include/ck/tensor_operation/gpu/block/blockwise_gemm_wmma.hpp
...ude/ck/tensor_operation/gpu/block/blockwise_gemm_wmma.hpp
+5
-0
No files found.
include/ck/ck.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -242,3 +245,5 @@ using index_t = int32_t;
...
@@ -242,3 +245,5 @@ using index_t = int32_t;
using
long_index_t
=
int64_t
;
using
long_index_t
=
int64_t
;
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/host_utility/device_prop.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#pragma once
#pragma once
#ifndef __HIPCC_RTC__
#include <string>
#include <string>
#include <map>
#include <map>
#include <hip/hip_runtime.h>
#include <hip/hip_runtime.h>
...
@@ -59,3 +63,5 @@ inline bool is_xdl_supported()
...
@@ -59,3 +63,5 @@ inline bool is_xdl_supported()
}
}
}
// namespace ck
}
// namespace ck
#endif
#pragma clang diagnostic pop
include/ck/host_utility/hip_check_error.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -15,3 +18,5 @@ inline void hip_check_error(hipError_t x)
...
@@ -15,3 +18,5 @@ inline void hip_check_error(hipError_t x)
throw
std
::
runtime_error
(
ss
.
str
());
throw
std
::
runtime_error
(
ss
.
str
());
}
}
}
}
#pragma clang diagnostic pop
include/ck/host_utility/io.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -39,3 +42,5 @@ std::ostream& operator<<(std::ostream& os, const ck::TensorDescriptor<Ts...>& de
...
@@ -39,3 +42,5 @@ std::ostream& operator<<(std::ostream& os, const ck::TensorDescriptor<Ts...>& de
return
os
;
return
os
;
}
}
#pragma clang diagnostic pop
include/ck/host_utility/kernel_launch.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -74,6 +77,76 @@ float launch_and_time_kernel(const StreamConfig& stream_config,
...
@@ -74,6 +77,76 @@ float launch_and_time_kernel(const StreamConfig& stream_config,
#endif
#endif
}
}
#ifndef __HIPCC_RTC__
template
<
typename
...
Args
,
typename
F
,
typename
PreProcessFunc
>
float
launch_and_time_kernel_with_preprocess
(
const
StreamConfig
&
stream_config
,
PreProcessFunc
preprocess
,
F
kernel
,
dim3
grid_dim
,
dim3
block_dim
,
std
::
size_t
lds_byte
,
Args
...
args
)
{
#if CK_TIME_KERNEL
if
(
stream_config
.
time_kernel_
)
{
#if DEBUG_LOG
printf
(
"%s: grid_dim {%d, %d, %d}, block_dim {%d, %d, %d}
\n
"
,
__func__
,
grid_dim
.
x
,
grid_dim
.
y
,
grid_dim
.
z
,
block_dim
.
x
,
block_dim
.
y
,
block_dim
.
z
);
printf
(
"Warm up 1 time
\n
"
);
#endif
// warm up
preprocess
();
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
args
...);
const
int
nrepeat
=
10
;
#if DEBUG_LOG
printf
(
"Start running %d times...
\n
"
,
nrepeat
);
#endif
hipEvent_t
start
,
stop
;
hip_check_error
(
hipEventCreate
(
&
start
));
hip_check_error
(
hipEventCreate
(
&
stop
));
hip_check_error
(
hipDeviceSynchronize
());
hip_check_error
(
hipEventRecord
(
start
,
stream_config
.
stream_id_
));
for
(
int
i
=
0
;
i
<
nrepeat
;
++
i
)
{
preprocess
();
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
args
...);
}
hip_check_error
(
hipEventRecord
(
stop
,
stream_config
.
stream_id_
));
hip_check_error
(
hipEventSynchronize
(
stop
));
float
total_time
=
0
;
hip_check_error
(
hipEventElapsedTime
(
&
total_time
,
start
,
stop
));
return
total_time
/
nrepeat
;
}
else
{
preprocess
();
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
args
...);
return
0
;
}
#else
kernel
<<<
grid_dim
,
block_dim
,
lds_byte
,
stream_config
.
stream_id_
>>>
(
args
...);
return
0
;
#endif
}
template
<
typename
...
Args
,
typename
F
,
typename
PreProcessFunc
>
template
<
typename
...
Args
,
typename
F
,
typename
PreProcessFunc
>
float
launch_and_time_kernel_with_preprocess
(
const
StreamConfig
&
stream_config
,
float
launch_and_time_kernel_with_preprocess
(
const
StreamConfig
&
stream_config
,
PreProcessFunc
preprocess
,
PreProcessFunc
preprocess
,
...
@@ -142,3 +215,6 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
...
@@ -142,3 +215,6 @@ float launch_and_time_kernel_with_preprocess(const StreamConfig& stream_config,
return
0
;
return
0
;
#endif
#endif
}
}
#endif
#pragma clang diagnostic pop
include/ck/host_utility/stream_utility.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -41,3 +44,5 @@ static inline int getAvailableComputeUnitCount(const StreamConfig& stream_config
...
@@ -41,3 +44,5 @@ static inline int getAvailableComputeUnitCount(const StreamConfig& stream_config
return
(
ret
);
return
(
ret
);
};
};
#pragma clang diagnostic pop
include/ck/problem_transform/transform_forward_convolution3d_into_gemm_v4r4r4_ndhwc_kzyxc_ndhwk.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -151,3 +154,5 @@ transform_forward_convolution3d_into_gemm_v4r4r4_ndhwc_kzyxc_ndhwk_pad(
...
@@ -151,3 +154,5 @@ transform_forward_convolution3d_into_gemm_v4r4r4_ndhwc_kzyxc_ndhwk_pad(
}
// namespace ck
}
// namespace ck
#endif
#endif
#pragma clang diagnostic pop
include/ck/stream_config.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -12,3 +15,5 @@ struct StreamConfig
...
@@ -12,3 +15,5 @@ struct StreamConfig
bool
time_kernel_
=
false
;
bool
time_kernel_
=
false
;
int
log_level_
=
0
;
int
log_level_
=
0
;
};
};
#pragma clang diagnostic pop
include/ck/tensor/static_tensor.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -271,3 +274,5 @@ __host__ __device__ constexpr auto make_static_tensor(TensorDesc, X invalid_elem
...
@@ -271,3 +274,5 @@ __host__ __device__ constexpr auto make_static_tensor(TensorDesc, X invalid_elem
}
// namespace ck
}
// namespace ck
#endif
#endif
#pragma clang diagnostic pop
include/ck/tensor_description/cluster_descriptor.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -32,3 +35,5 @@ __host__ __device__ constexpr auto make_cluster_descriptor(
...
@@ -32,3 +35,5 @@ __host__ __device__ constexpr auto make_cluster_descriptor(
}
}
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/tensor_description/multi_index_transform.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -1952,3 +1955,5 @@ struct Modulo
...
@@ -1952,3 +1955,5 @@ struct Modulo
}
}
};
};
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/tensor_description/multi_index_transform_helper.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -128,3 +131,5 @@ __host__ __device__ constexpr auto make_modulo_transform(const Modulus& modulus,
...
@@ -128,3 +131,5 @@ __host__ __device__ constexpr auto make_modulo_transform(const Modulus& modulus,
return
Modulo
<
Modulus
,
UpLength
>
{
modulus
,
up_length
};
return
Modulo
<
Modulus
,
UpLength
>
{
modulus
,
up_length
};
}
}
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/tensor_description/tensor_adaptor.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -480,3 +483,5 @@ __host__ __device__ constexpr auto chain_tensor_adaptors(const X& x, const Xs&..
...
@@ -480,3 +483,5 @@ __host__ __device__ constexpr auto chain_tensor_adaptors(const X& x, const Xs&..
}
}
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/tensor_description/tensor_descriptor.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -613,3 +616,5 @@ using TensorCoordinateStep_t = decltype(make_tensor_coordinate_step(
...
@@ -613,3 +616,5 @@ using TensorCoordinateStep_t = decltype(make_tensor_coordinate_step(
TensorDesc
{},
MultiIndex
<
remove_cvref_t
<
TensorDesc
>::
GetNumOfDimension
()
>
{}));
TensorDesc
{},
MultiIndex
<
remove_cvref_t
<
TensorDesc
>::
GetNumOfDimension
()
>
{}));
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/tensor_description/tensor_descriptor_helper.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -163,3 +166,5 @@ make_naive_tensor_descriptor_aligned(const Tuple<Lengths...>& lengths, Align ali
...
@@ -163,3 +166,5 @@ make_naive_tensor_descriptor_aligned(const Tuple<Lengths...>& lengths, Align ali
}
}
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/tensor_description/tensor_space_filling_curve.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -160,3 +163,5 @@ struct SpaceFillingCurve
...
@@ -160,3 +163,5 @@ struct SpaceFillingCurve
};
};
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/tensor_operation/gpu/block/blockwise_gemm_dl_v2r3.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -410,3 +413,5 @@ struct BlockwiseGemmDl_A_BK0_BM_BK1_B_BK0_BN_BK1_C_BM0_BM1_BN0_BN1_pipeline_BM0_
...
@@ -410,3 +413,5 @@ struct BlockwiseGemmDl_A_BK0_BM_BK1_B_BK0_BN_BK1_C_BM0_BM1_BN0_BN1_pipeline_BM0_
};
};
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
include/ck/tensor_operation/gpu/block/blockwise_gemm_dlops_v2r2.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -395,3 +398,5 @@ struct BlockwiseGemmDlops_km_kn_m0m1n0n1_v2r2_pipeline_2x2
...
@@ -395,3 +398,5 @@ struct BlockwiseGemmDlops_km_kn_m0m1n0n1_v2r2_pipeline_2x2
}
// namespace ck
}
// namespace ck
#endif
#endif
#pragma clang diagnostic pop
include/ck/tensor_operation/gpu/block/blockwise_gemm_dlops_v3.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -176,3 +179,5 @@ struct BlockwiseGemmDlops_km_kn_m0m1n0n1_v3
...
@@ -176,3 +179,5 @@ struct BlockwiseGemmDlops_km_kn_m0m1n0n1_v3
}
// namespace ck
}
// namespace ck
#endif
#endif
#pragma clang diagnostic pop
include/ck/tensor_operation/gpu/block/blockwise_gemm_wmma.hpp
View file @
253f942b
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
...
@@ -799,3 +802,5 @@ struct BlockwiseGemmWMMA_k0mk1_k0nk1_m0m1m2n0n1n2m3_CShuffle_FIFO
...
@@ -799,3 +802,5 @@ struct BlockwiseGemmWMMA_k0mk1_k0nk1_m0m1m2n0n1n2m3_CShuffle_FIFO
};
};
}
// namespace ck
}
// namespace ck
#pragma clang diagnostic pop
Prev
1
2
3
4
5
…
14
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment