Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@
#endif
#endif
#define ROCPRIM_IS_CDNA4() __builtin_amdgcn_processor_is("gfx950")
#define ROCPRIM_IS_CDNA3() \
(__builtin_amdgcn_processor_is("gfx942") || __builtin_amdgcn_processor_is("gfx950") \
Comment thread
stanleytsang-amd marked this conversation as resolved.
Resolved
#define ROCPRIM_IS_CDNA3() \
(__builtin_amdgcn_processor_is("gfx942") \
|| __builtin_amdgcn_processor_is("gfx9-4-generic"))
#define ROCPRIM_IS_CDNA2() (__builtin_amdgcn_processor_is("gfx90a"))
#define ROCPRIM_IS_CDNA1() (__builtin_amdgcn_processor_is("gfx908"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ enum class gpu
mi308x,
mi325x,
mi350x,
mi355x,
mi455x
};

Expand Down Expand Up @@ -268,6 +269,7 @@ constexpr gen gen_from_target_arch(target_arch i)

constexpr std::tuple<std::string_view, gpu> target_gpu_names[] = {
std::make_tuple<std::string_view, gpu>("MI455X", gpu::mi455x),
std::make_tuple<std::string_view, gpu>("MI355X", gpu::mi355x),
std::make_tuple<std::string_view, gpu>("MI350X", gpu::mi350x),
std::make_tuple<std::string_view, gpu>("MI325X", gpu::mi325x),
std::make_tuple<std::string_view, gpu>("MI308X", gpu::mi308x),
Expand Down Expand Up @@ -856,15 +858,18 @@ hipError_t execute_launch_plan(
return hipGetLastError();
}

template<class Config, class Target>
template<class Config,
class Target,
arch::wavefront::target Wavefront = get_wavefront_size(Target::g)>
struct launch_manager
{
template<class ConfigSelector,
template<class, class, class> class LaunchSelector = default_config_static_selector,
class Kernel>
launch_plan<Kernel> make_launch_plan(Kernel kernel) const
{
return {trampoline_kernel<Config, ConfigSelector, Kernel, Target, LaunchSelector>, kernel};
return {trampoline_kernel<Config, ConfigSelector, Kernel, Target, LaunchSelector, Wavefront>,
kernel};
}

template<class ConfigSelector,
Expand Down Expand Up @@ -897,8 +902,6 @@ hipError_t visit_config(const hipStream_t stream, Visitor visitor)
// This is an instance of 'comp_target', which is only interesting as a type.
using SelectedConfigTarget = decltype(selected_config_target);

using Launcher = launch_manager<Config, SelectedConfigTarget>;

// Extract the targeted wavefront of this config. It may be a fallback config
// with unknown wavefront size.
constexpr arch::wavefront::target selected_config_wavefront
Expand All @@ -908,6 +911,7 @@ hipError_t visit_config(const hipStream_t stream, Visitor visitor)
if constexpr(selected_config_wavefront != arch::wavefront::target::dynamic)
{
// We have to convert the wavefront target to a compile time type s.t. we can consume it in a constexpr manner.
using Launcher = launch_manager<Config, SelectedConfigTarget>;
return visitor(
Launcher{},
Config{},
Expand All @@ -928,6 +932,12 @@ hipError_t visit_config(const hipStream_t stream, Visitor visitor)
return std::visit(
[&](auto wavefront_target)
{
// Pass the wavefront explicitly, as the default would resolve to
// `dynamic` on the host but to a concrete size in the device pass.
using Launcher
= launch_manager<Config,
SelectedConfigTarget,
decltype(wavefront_target)::value>;
return visitor(Launcher{},
Config{},
SelectedConfigTarget{},
Expand Down
Loading