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
d8de5ea5
"...composable_kernel.git" did not exist on "29496c95d3d04eafae5eb9d0de2b3e4673df3a73"
Commit
d8de5ea5
authored
Feb 14, 2025
by
Astha Rai
Browse files
updated header guards
parent
0f34703a
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
25 additions
and
134 deletions
+25
-134
include/ck/ck.hpp
include/ck/ck.hpp
+1
-6
include/ck/tensor_operation/gpu/device/device_base.hpp
include/ck/tensor_operation/gpu/device/device_base.hpp
+3
-14
include/ck/tensor_operation/gpu/device/gemm_specialization.hpp
...de/ck/tensor_operation/gpu/device/gemm_specialization.hpp
+1
-7
include/ck/tensor_operation/gpu/device/tensor_layout.hpp
include/ck/tensor_operation/gpu/device/tensor_layout.hpp
+1
-6
include/ck/tensor_operation/gpu/element/unary_element_wise_operation.hpp
...or_operation/gpu/element/unary_element_wise_operation.hpp
+1
-7
include/ck/tensor_operation/gpu/grid/block_to_ctile_map.hpp
include/ck/tensor_operation/gpu/grid/block_to_ctile_map.hpp
+1
-7
include/ck/tensor_operation/gpu/grid/gridwise_gemm_multiple_d_xdl_cshuffle.hpp
...ration/gpu/grid/gridwise_gemm_multiple_d_xdl_cshuffle.hpp
+2
-6
include/ck/tensor_operation/gpu/grid/gridwise_gemm_pipeline_selector.hpp
...or_operation/gpu/grid/gridwise_gemm_pipeline_selector.hpp
+3
-13
include/ck/utility/amd_wave_read_first_lane.hpp
include/ck/utility/amd_wave_read_first_lane.hpp
+1
-7
include/ck/utility/data_type.hpp
include/ck/utility/data_type.hpp
+2
-10
include/ck/utility/enable_if.hpp
include/ck/utility/enable_if.hpp
+1
-7
include/ck/utility/loop_scheduler.hpp
include/ck/utility/loop_scheduler.hpp
+2
-10
include/ck/utility/math_v2.hpp
include/ck/utility/math_v2.hpp
+1
-7
include/ck/utility/sequence.hpp
include/ck/utility/sequence.hpp
+2
-10
include/ck/utility/tuple_helper.hpp
include/ck/utility/tuple_helper.hpp
+2
-10
include/ck/utility/type.hpp
include/ck/utility/type.hpp
+1
-7
No files found.
include/ck/ck.hpp
View file @
d8de5ea5
...
@@ -2,20 +2,15 @@
...
@@ -2,20 +2,15 @@
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#include "ck/config.h"
#include "ck/config.h"
#if
n
def
__HIPCC_RTC__
#if
!
def
ined(
__HIPCC_RTC__
) || !defined(CK_CODE_GEN_RTC)
#include "ck/utility/env.hpp"
#include "ck/utility/env.hpp"
#ifndef CK_CODE_GEN_RTC
#ifndef CK_DONT_USE_HIP_RUNTIME_HEADERS
#ifndef CK_DONT_USE_HIP_RUNTIME_HEADERS
#include "hip/hip_runtime.h"
#include "hip/hip_runtime.h"
#include "hip/hip_fp16.h"
#include "hip/hip_fp16.h"
#endif
#endif
#endif
// environment variable to enable logging:
// environment variable to enable logging:
// export CK_LOGGING=ON or CK_LOGGING=1 or CK_LOGGING=ENABLED
// export CK_LOGGING=ON or CK_LOGGING=1 or CK_LOGGING=ENABLED
...
...
include/ck/tensor_operation/gpu/device/device_base.hpp
View file @
d8de5ea5
...
@@ -3,12 +3,7 @@
...
@@ -3,12 +3,7 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#define CK_CODE_GEN_RTC
#endif
#ifndef __HIPCC_RTC__
#ifndef CK_CODE_GEN_RTC
#include <string>
#include <string>
#include <sstream>
#include <sstream>
#include <regex>
#include <regex>
...
@@ -16,14 +11,12 @@
...
@@ -16,14 +11,12 @@
#include "ck/stream_config.hpp"
#include "ck/stream_config.hpp"
#endif
#endif
#endif
namespace
ck
{
namespace
ck
{
namespace
tensor_operation
{
namespace
tensor_operation
{
namespace
device
{
namespace
device
{
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
#define GET_OBJECT_NAME_IMLP \
#define GET_OBJECT_NAME_IMLP \
std::optional<std::string> GetObjectName() const override \
std::optional<std::string> GetObjectName() const override \
{ \
{ \
...
@@ -52,7 +45,6 @@ namespace device {
...
@@ -52,7 +45,6 @@ namespace device {
#define REGISTER_EXTRA_PRINTING_METHODS GET_OBJECT_NAME_IMLP GET_TEMPLATE_INFO_IMPL
#define REGISTER_EXTRA_PRINTING_METHODS GET_OBJECT_NAME_IMLP GET_TEMPLATE_INFO_IMPL
#endif
#endif
#endif
#ifndef CK_CODE_GEN_RTC
#ifndef CK_CODE_GEN_RTC
struct
BaseArgument
struct
BaseArgument
...
@@ -86,9 +78,7 @@ struct BaseOperator
...
@@ -86,9 +78,7 @@ struct BaseOperator
BaseOperator
()
=
default
;
BaseOperator
()
=
default
;
BaseOperator
(
const
BaseOperator
&
)
=
default
;
BaseOperator
(
const
BaseOperator
&
)
=
default
;
BaseOperator
&
operator
=
(
const
BaseOperator
&
)
=
default
;
BaseOperator
&
operator
=
(
const
BaseOperator
&
)
=
default
;
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
virtual
bool
IsSupportedArgument
(
const
BaseArgument
*
)
{
return
false
;
}
virtual
bool
IsSupportedArgument
(
const
BaseArgument
*
)
{
return
false
;
}
virtual
std
::
string
GetTypeString
()
const
{
return
""
;
}
virtual
std
::
string
GetTypeString
()
const
{
return
""
;
}
...
@@ -116,7 +106,6 @@ struct BaseOperator
...
@@ -116,7 +106,6 @@ struct BaseOperator
assert
(
p_arg
);
assert
(
p_arg
);
p_arg
->
p_workspace_
=
p_workspace
;
p_arg
->
p_workspace_
=
p_workspace
;
}
}
#endif
#endif
#endif
virtual
~
BaseOperator
()
{}
virtual
~
BaseOperator
()
{}
};
};
...
...
include/ck/tensor_operation/gpu/device/gemm_specialization.hpp
View file @
d8de5ea5
...
@@ -3,10 +3,6 @@
...
@@ -3,10 +3,6 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
namespace
ck
{
namespace
ck
{
namespace
tensor_operation
{
namespace
tensor_operation
{
namespace
device
{
namespace
device
{
...
@@ -32,8 +28,7 @@ enum struct GemmSpecialization
...
@@ -32,8 +28,7 @@ enum struct GemmSpecialization
NKOPadding
,
NKOPadding
,
MNKOPadding
,
MNKOPadding
,
};
};
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
inline
std
::
string
getGemmSpecializationString
(
const
GemmSpecialization
&
s
)
inline
std
::
string
getGemmSpecializationString
(
const
GemmSpecialization
&
s
)
{
{
switch
(
s
)
switch
(
s
)
...
@@ -58,7 +53,6 @@ inline std::string getGemmSpecializationString(const GemmSpecialization& s)
...
@@ -58,7 +53,6 @@ inline std::string getGemmSpecializationString(const GemmSpecialization& s)
}
}
}
}
#endif
#endif
#endif
}
// namespace device
}
// namespace device
}
// namespace tensor_operation
}
// namespace tensor_operation
...
...
include/ck/tensor_operation/gpu/device/tensor_layout.hpp
View file @
d8de5ea5
...
@@ -2,9 +2,6 @@
...
@@ -2,9 +2,6 @@
// Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
namespace
ck
{
namespace
ck
{
namespace
tensor_layout
{
namespace
tensor_layout
{
...
@@ -433,8 +430,7 @@ struct G_NDHW : public BaseTensorLayout
...
@@ -433,8 +430,7 @@ struct G_NDHW : public BaseTensorLayout
}
// namespace convolution
}
// namespace convolution
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
template
<
template
<
typename
Layout
,
typename
Layout
,
typename
std
::
enable_if
<
std
::
is_base_of
<
BaseTensorLayout
,
Layout
>
::
value
,
bool
>::
type
=
false
>
typename
std
::
enable_if
<
std
::
is_base_of
<
BaseTensorLayout
,
Layout
>
::
value
,
bool
>::
type
=
false
>
...
@@ -444,7 +440,6 @@ std::ostream& operator<<(std::ostream& os, const Layout&)
...
@@ -444,7 +440,6 @@ std::ostream& operator<<(std::ostream& os, const Layout&)
return
os
;
return
os
;
}
}
#endif
#endif
#endif
}
// namespace tensor_layout
}
// namespace tensor_layout
}
// namespace ck
}
// namespace ck
include/ck/tensor_operation/gpu/element/unary_element_wise_operation.hpp
View file @
d8de5ea5
...
@@ -3,10 +3,6 @@
...
@@ -3,10 +3,6 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#include "ck/utility/data_type.hpp"
#include "ck/utility/data_type.hpp"
#include "ck/utility/math.hpp"
#include "ck/utility/math.hpp"
#include "ck/utility/math_v2.hpp"
#include "ck/utility/math_v2.hpp"
...
@@ -695,8 +691,7 @@ struct FastGelu
...
@@ -695,8 +691,7 @@ struct FastGelu
template
<
typename
Y
,
typename
X
>
template
<
typename
Y
,
typename
X
>
__device__
void
operator
()(
Y
&
y
,
const
X
&
x
)
const
;
__device__
void
operator
()(
Y
&
y
,
const
X
&
x
)
const
;
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
template
<
>
template
<
>
__host__
void
operator
()
<
float
,
float
>
(
float
&
y
,
const
float
&
x
)
const
__host__
void
operator
()
<
float
,
float
>
(
float
&
y
,
const
float
&
x
)
const
{
{
...
@@ -707,7 +702,6 @@ struct FastGelu
...
@@ -707,7 +702,6 @@ struct FastGelu
const
float
emu
=
exp
(
u
);
const
float
emu
=
exp
(
u
);
y
=
x
/
(
1.
f
+
emu
);
y
=
x
/
(
1.
f
+
emu
);
}
}
#endif
#endif
#endif
// device code, use lower precision "__ocml_exp_f32" and "rcp"
// device code, use lower precision "__ocml_exp_f32" and "rcp"
template
<
>
template
<
>
...
...
include/ck/tensor_operation/gpu/grid/block_to_ctile_map.hpp
View file @
d8de5ea5
...
@@ -3,21 +3,15 @@
...
@@ -3,21 +3,15 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#include "ck/utility/math.hpp"
#include "ck/utility/math.hpp"
#include "ck/utility/number.hpp"
#include "ck/utility/number.hpp"
#include "ck/utility/tuple.hpp"
#include "ck/utility/tuple.hpp"
#include "ck/tensor_description/tensor_adaptor.hpp"
#include "ck/tensor_description/tensor_adaptor.hpp"
#include "ck/tensor_description/multi_index_transform_helper.hpp"
#include "ck/tensor_description/multi_index_transform_helper.hpp"
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
#include <limits>
#include <limits>
#include <stdlib.h>
#include <stdlib.h>
#endif
#endif
#endif
namespace
ck
{
namespace
ck
{
...
...
include/ck/tensor_operation/gpu/grid/gridwise_gemm_multiple_d_xdl_cshuffle.hpp
View file @
d8de5ea5
...
@@ -3,10 +3,6 @@
...
@@ -3,10 +3,6 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#include "ck/utility/common_header.hpp"
#include "ck/utility/common_header.hpp"
#include "ck/tensor_description/multi_index_transform_helper.hpp"
#include "ck/tensor_description/multi_index_transform_helper.hpp"
#include "ck/tensor_description/tensor_descriptor.hpp"
#include "ck/tensor_description/tensor_descriptor.hpp"
...
@@ -477,7 +473,7 @@ struct GridwiseGemmMultipleD_xdl_cshuffle
...
@@ -477,7 +473,7 @@ struct GridwiseGemmMultipleD_xdl_cshuffle
return
matrix_padder
.
PadCDescriptor_M_N
(
e_grid_desc_mraw_nraw
);
return
matrix_padder
.
PadCDescriptor_M_N
(
e_grid_desc_mraw_nraw
);
}
}
#ifdef
CK_CODE_GEN_RTC
#if
def
ined(__HIPCC_RTC__) || defined(
CK_CODE_GEN_RTC
)
template
<
typename
DsLayout
,
GemmSpecialization
GemmSpec
>
template
<
typename
DsLayout
,
GemmSpecialization
GemmSpec
>
__host__
__device__
static
auto
__host__
__device__
static
auto
MakeDsGridDescriptor_M_N
(
const
ck
::
Array
<
index_t
,
NumDTensor
>&
MRaws
,
MakeDsGridDescriptor_M_N
(
const
ck
::
Array
<
index_t
,
NumDTensor
>&
MRaws
,
...
@@ -954,7 +950,7 @@ struct GridwiseGemmMultipleD_xdl_cshuffle
...
@@ -954,7 +950,7 @@ struct GridwiseGemmMultipleD_xdl_cshuffle
const
index_t
K
,
const
index_t
K
,
const
index_t
StrideA
,
const
index_t
StrideA
,
const
index_t
StrideB
,
const
index_t
StrideB
,
#ifdef
CK_CODE_GEN_RTC
#if
def
ined(__HIPCC_RTC__) || defined(
CK_CODE_GEN_RTC
)
const
ck
::
Array
<
index_t
,
NumDTensor
>
StrideDs
,
const
ck
::
Array
<
index_t
,
NumDTensor
>
StrideDs
,
#else
#else
const
std
::
array
<
index_t
,
NumDTensor
>
StrideDs
,
const
std
::
array
<
index_t
,
NumDTensor
>
StrideDs
,
...
...
include/ck/tensor_operation/gpu/grid/gridwise_gemm_pipeline_selector.hpp
View file @
d8de5ea5
...
@@ -3,16 +3,10 @@
...
@@ -3,16 +3,10 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#define CK_CODE_GEN_RTC
#endif
#ifndef __HIPCC_RTC__
#ifndef CK_CODE_GEN_RTC
#include <iostream>
#include <iostream>
#include <ostream>
#include <ostream>
#endif
#endif
#endif
#include "ck/tensor_operation/gpu/grid/gridwise_gemm_pipeline_v1.hpp"
#include "ck/tensor_operation/gpu/grid/gridwise_gemm_pipeline_v1.hpp"
#include "ck/tensor_operation/gpu/grid/gridwise_gemm_pipeline_v2.hpp"
#include "ck/tensor_operation/gpu/grid/gridwise_gemm_pipeline_v2.hpp"
...
@@ -61,18 +55,15 @@ constexpr auto GridwiseGemmPipeline_Selector()
...
@@ -61,18 +55,15 @@ constexpr auto GridwiseGemmPipeline_Selector()
}
}
else
else
{
{
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
std
::
cerr
<<
"GridwiseGemmPipeline configuration is not available"
<<
std
::
endl
;
std
::
cerr
<<
"GridwiseGemmPipeline configuration is not available"
<<
std
::
endl
;
#endif
#endif
#endif
}
}
}
}
}
// namespace ck
}
// namespace ck
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
PipelineVersion
&
p
)
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
PipelineVersion
&
p
)
{
{
switch
(
p
)
switch
(
p
)
...
@@ -86,4 +77,3 @@ inline std::ostream& operator<<(std::ostream& os, const ck::PipelineVersion& p)
...
@@ -86,4 +77,3 @@ inline std::ostream& operator<<(std::ostream& os, const ck::PipelineVersion& p)
return
os
;
return
os
;
}
}
#endif
#endif
#endif
include/ck/utility/amd_wave_read_first_lane.hpp
View file @
d8de5ea5
...
@@ -3,22 +3,16 @@
...
@@ -3,22 +3,16 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#include "ck/ck.hpp"
#include "ck/ck.hpp"
#include "ck/utility/functional2.hpp"
#include "ck/utility/functional2.hpp"
#include "ck/utility/math.hpp"
#include "ck/utility/math.hpp"
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
#include <array>
#include <array>
#include <cstddef>
#include <cstddef>
#include <cstdint>
#include <cstdint>
#include <type_traits>
#include <type_traits>
#endif
#endif
#endif
namespace
ck
{
namespace
ck
{
namespace
detail
{
namespace
detail
{
...
...
include/ck/utility/data_type.hpp
View file @
d8de5ea5
...
@@ -3,35 +3,27 @@
...
@@ -3,35 +3,27 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#include "ck/utility/amd_ck_fp8.hpp"
#include "ck/utility/amd_ck_fp8.hpp"
#include "ck/utility/e8m0.hpp"
#include "ck/utility/e8m0.hpp"
#include "ck/utility/statically_indexed_array.hpp"
#include "ck/utility/statically_indexed_array.hpp"
#ifdef __HIPCC_RTC__
/// Definitions from <cstdint>, <cmath> conflict with
/// Definitions from <cstdint>, <cmath> conflict with
/// /opt/rocm/include/hip/amd_detail/amd_hip_vector_types.h.
/// /opt/rocm/include/hip/amd_detail/amd_hip_vector_types.h.
#ifdef
CK_CODE_GEN_RTC
#if
def
ined(__HIPCC_RTC__) || defined(
CK_CODE_GEN_RTC
)
using
int8_t
=
signed
char
;
using
int8_t
=
signed
char
;
using
uint8_t
=
unsigned
char
;
using
uint8_t
=
unsigned
char
;
using
int16_t
=
signed
short
;
using
int16_t
=
signed
short
;
using
uint16_t
=
unsigned
short
;
using
uint16_t
=
unsigned
short
;
using
float_t
=
float
;
using
float_t
=
float
;
#endif
#endif // __HIPCC_RTC__
#endif // __HIPCC_RTC__
namespace
ck
{
namespace
ck
{
#ifdef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifdef CK_CODE_GEN_RTC
using
byte
=
unsigned
char
;
using
byte
=
unsigned
char
;
#else
#else
using
std
::
byte
;
using
std
::
byte
;
#endif
#endif
#endif
using
bhalf_t
=
ushort
;
using
bhalf_t
=
ushort
;
using
half_t
=
_Float16
;
using
half_t
=
_Float16
;
...
...
include/ck/utility/enable_if.hpp
View file @
d8de5ea5
...
@@ -3,13 +3,8 @@
...
@@ -3,13 +3,8 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
namespace
ck
{
namespace
ck
{
#ifdef __HIPCC_RTC__
#if defined(__HIPCC_RTC__) || defined(CK_CODE_GEN_RTC)
#ifdef CK_CODE_GEN_RTC
template
<
bool
B
,
class
T
=
void
>
template
<
bool
B
,
class
T
=
void
>
struct
enable_if
struct
enable_if
{
{
...
@@ -31,5 +26,4 @@ using enable_if = std::enable_if<B, T>;
...
@@ -31,5 +26,4 @@ using enable_if = std::enable_if<B, T>;
template
<
bool
B
,
typename
T
=
void
>
template
<
bool
B
,
typename
T
=
void
>
using
enable_if_t
=
typename
std
::
enable_if
<
B
,
T
>::
type
;
using
enable_if_t
=
typename
std
::
enable_if
<
B
,
T
>::
type
;
#endif
#endif
#endif
}
// namespace ck
}
// namespace ck
include/ck/utility/loop_scheduler.hpp
View file @
d8de5ea5
...
@@ -3,15 +3,9 @@
...
@@ -3,15 +3,9 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#define CK_CODE_GEN_RTC
#endif
#ifndef __HIPCC_RTC__
#ifndef CK_CODE_GEN_RTC
#include <ostream>
#include <ostream>
#endif
#endif
#endif
#include "ck/utility/common_header.hpp"
#include "ck/utility/common_header.hpp"
...
@@ -34,8 +28,7 @@ constexpr LoopScheduler make_default_loop_scheduler()
...
@@ -34,8 +28,7 @@ constexpr LoopScheduler make_default_loop_scheduler()
}
// namespace ck
}
// namespace ck
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
LoopScheduler
&
s
)
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
LoopScheduler
&
s
)
{
{
switch
(
s
)
switch
(
s
)
...
@@ -47,4 +40,3 @@ inline std::ostream& operator<<(std::ostream& os, const ck::LoopScheduler& s)
...
@@ -47,4 +40,3 @@ inline std::ostream& operator<<(std::ostream& os, const ck::LoopScheduler& s)
return
os
;
return
os
;
}
}
#endif
#endif
#endif
include/ck/utility/math_v2.hpp
View file @
d8de5ea5
...
@@ -3,10 +3,6 @@
...
@@ -3,10 +3,6 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#ifndef __HIP_DEVICE_COMPILE__
#ifndef __HIP_DEVICE_COMPILE__
#include <cmath>
#include <cmath>
#endif
#endif
...
@@ -22,9 +18,8 @@ namespace math {
...
@@ -22,9 +18,8 @@ namespace math {
extern
"C"
__device__
float
__ocml_native_recip_f32
(
float
);
extern
"C"
__device__
float
__ocml_native_recip_f32
(
float
);
#endif
#endif
#ifndef __HIPCC_RTC__
// math functions for the host, some are implemented by calling C++ std functions
// math functions for the host, some are implemented by calling C++ std functions
#if
ndef
CK_CODE_GEN_RTC
#if
!defined(__HIPCC_RTC__) || !defined(
CK_CODE_GEN_RTC
)
static
inline
__host__
float
abs
(
float
x
)
{
return
std
::
abs
(
x
);
};
static
inline
__host__
float
abs
(
float
x
)
{
return
std
::
abs
(
x
);
};
static
inline
__host__
double
abs
(
double
x
)
{
return
std
::
abs
(
x
);
};
static
inline
__host__
double
abs
(
double
x
)
{
return
std
::
abs
(
x
);
};
...
@@ -465,7 +460,6 @@ inline __host__ double expm1<double>(double x)
...
@@ -465,7 +460,6 @@ inline __host__ double expm1<double>(double x)
return
std
::
expm1
(
x
);
return
std
::
expm1
(
x
);
}
}
#endif
#endif
#endif
// math functions for the HIP kernel, some are implemented by calling hip builtin functions
// math functions for the HIP kernel, some are implemented by calling hip builtin functions
static
inline
__device__
float
abs
(
float
x
)
{
return
::
abs
(
x
);
};
static
inline
__device__
float
abs
(
float
x
)
{
return
::
abs
(
x
);
};
...
...
include/ck/utility/sequence.hpp
View file @
d8de5ea5
...
@@ -3,15 +3,9 @@
...
@@ -3,15 +3,9 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#define CK_CODE_GEN_RTC
#endif
#ifndef __HIPCC_RTC__
#ifndef CK_CODE_GEN_RTC
#include <ostream>
#include <ostream>
#endif
#endif
#endif
#include "ck/utility/integral_constant.hpp"
#include "ck/utility/integral_constant.hpp"
#include "ck/utility/type.hpp"
#include "ck/utility/type.hpp"
...
@@ -908,8 +902,7 @@ using uniform_sequence_gen_t = typename uniform_sequence_gen<NSize, I>::type;
...
@@ -908,8 +902,7 @@ using uniform_sequence_gen_t = typename uniform_sequence_gen<NSize, I>::type;
}
// namespace ck
}
// namespace ck
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
template
<
ck
::
index_t
...
Is
>
template
<
ck
::
index_t
...
Is
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
Sequence
<
Is
...
>
)
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
Sequence
<
Is
...
>
)
{
{
...
@@ -921,4 +914,3 @@ std::ostream& operator<<(std::ostream& os, const ck::Sequence<Is...>)
...
@@ -921,4 +914,3 @@ std::ostream& operator<<(std::ostream& os, const ck::Sequence<Is...>)
return
os
;
return
os
;
}
}
#endif
#endif
#endif
include/ck/utility/tuple_helper.hpp
View file @
d8de5ea5
...
@@ -3,10 +3,6 @@
...
@@ -3,10 +3,6 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#include "functional4.hpp"
#include "functional4.hpp"
#include "tuple.hpp"
#include "tuple.hpp"
#ifndef CK_CODE_GEN_RTC
#ifndef CK_CODE_GEN_RTC
...
@@ -163,22 +159,18 @@ __host__ __device__ constexpr auto TupleReduce(F&& f, const Tuple<Ts...>& tuple)
...
@@ -163,22 +159,18 @@ __host__ __device__ constexpr auto TupleReduce(F&& f, const Tuple<Ts...>& tuple)
}
}
}
}
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
template
<
typename
T
>
template
<
typename
T
>
using
is_tuple
=
decltype
(
ck
::
declval
<
T
&>
().
IsTuple
());
using
is_tuple
=
decltype
(
ck
::
declval
<
T
&>
().
IsTuple
());
#endif
#endif
#endif
template
<
typename
...
Ts
>
template
<
typename
...
Ts
>
__host__
__device__
constexpr
auto
IsNestedTuple
(
const
Tuple
<
Ts
...
>&
)
__host__
__device__
constexpr
auto
IsNestedTuple
(
const
Tuple
<
Ts
...
>&
)
{
{
#ifndef __HIPCC_RTC__
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
#ifndef CK_CODE_GEN_RTC
return
(
is_detected
<
is_tuple
,
Ts
>::
value
||
...);
return
(
is_detected
<
is_tuple
,
Ts
>::
value
||
...);
#endif
#endif
}
}
#endif
template
<
index_t
depth
=
0
,
typename
T
>
template
<
index_t
depth
=
0
,
typename
T
>
__host__
__device__
constexpr
auto
TupleDepth
(
const
T
&
)
__host__
__device__
constexpr
auto
TupleDepth
(
const
T
&
)
...
...
include/ck/utility/type.hpp
View file @
d8de5ea5
...
@@ -3,17 +3,12 @@
...
@@ -3,17 +3,12 @@
#pragma once
#pragma once
#ifdef _HIPCC_RTC_
#define CK_CODE_GEN_RTC
#endif
#include "ck/ck.hpp"
#include "ck/ck.hpp"
#include "ck/utility/enable_if.hpp"
#include "ck/utility/enable_if.hpp"
#include "ck/utility/integral_constant.hpp"
#include "ck/utility/integral_constant.hpp"
namespace
ck
{
namespace
ck
{
#ifdef __HIPCC_RTC__
#if defined(__HIPCC_RTC__) || defined(CK_CODE_GEN_RTC)
#ifdef CK_CODE_GEN_RTC
// NOLINTNEXTLINE
// NOLINTNEXTLINE
#define CK_BUILTIN_TYPE_TRAIT1(name) \
#define CK_BUILTIN_TYPE_TRAIT1(name) \
template <class T> \
template <class T> \
...
@@ -176,7 +171,6 @@ using std::remove_pointer;
...
@@ -176,7 +171,6 @@ using std::remove_pointer;
using
std
::
remove_reference
;
using
std
::
remove_reference
;
using
std
::
void_t
;
using
std
::
void_t
;
#endif
#endif
#endif
template
<
typename
X
,
typename
Y
>
template
<
typename
X
,
typename
Y
>
struct
is_same
:
public
integral_constant
<
bool
,
false
>
struct
is_same
:
public
integral_constant
<
bool
,
false
>
...
...
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