Skip to content

Commit

Permalink
temp3
Browse files Browse the repository at this point in the history
  • Loading branch information
apwojcik committed Oct 2, 2023
1 parent 5c426ab commit b20487d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
13 changes: 12 additions & 1 deletion src/include/migraphx/op/random_uniform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,18 @@ struct random_uniform

result.visit([&](auto output) {
using type = typename decltype(output)::value_type;
if constexpr(std::is_integral<type>{})
if constexpr(std::is_integral_v<type>
#ifdef _MSC_VER
// According to the C++ specification, the effect is undefined if the result type for
// the generator is not one of short, int, long, long long, unsigned short, unsigned int,
// unsigned long, or unsigned long long.
// See https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution.
//
// The standard library of Microsoft Visual C++ compiler is strict about that.
// The Clang C++ compiler uses the standard library from Microsoft Visual C++ compiler.
&& !(std::is_same_v<type, unsigned char> || std::is_same_v<type, signed char>)
#endif
)
{
// default range for all integer types is
// (0, std::uniform_int_distribution<type>::max()).
Expand Down
1 change: 1 addition & 0 deletions src/include/migraphx/pad_calc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ shape compute_padded_shape(const shape& input,

// Used for dynamic auto padding of pooling operators where padding needs to be computed at
// evaulation time.
MIGRAPHX_EXPORT
shape compute_padded_pool_shape(const shape& input,
const shape& kernel,
const std::vector<std::size_t>& padding,
Expand Down
1 change: 1 addition & 0 deletions src/targets/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ add_library(migraphx_device
device/reverse.cpp
device/rnn_variable_seq_lens.cpp
device/scatter.cpp
device/targets.cpp
device/topk.cpp)

set_target_properties(migraphx_device PROPERTIES EXPORT_NAME device)
Expand Down
5 changes: 1 addition & 4 deletions src/targets/gpu/compile_hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,7 @@ bool hip_has_flags(const std::vector<std::string>& flags)
join_strings(flags, " ") + " -x hip -c --offload-arch=gfx900 --cuda-device-only";

std::string src;
src_file input;
input.path = "main.cpp";
input.content = std::make_pair(src.data(), src.data() + src.size());

src_file input{ "main.cpp", src };
try
{
compiler.compile({input});
Expand Down
6 changes: 5 additions & 1 deletion src/targets/gpu/device/targets.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef MIGRAPHX_GUARD_DEVICE_TARGETS_CPP
#define MIGRAPHX_GUARD_DEVICE_TARGETS_CPP

#include <migraphx/config.hpp>
#include <migraphx/gpu/device/config.hpp>
#include <string>
#include <vector>

Expand All @@ -34,9 +34,13 @@ namespace gpu {
namespace device {
#define MIGRAPHX_GPU_TARGETS "@GPU_TARGETS@" // NOLINT

MIGRAPHX_DEVICE_EXPORT
const std::vector<std::string>& get_targets();

MIGRAPHX_DEVICE_EXPORT
std::string get_targets_as_string();

MIGRAPHX_DEVICE_EXPORT
std::string get_device_name();

} // namespace device
Expand Down

0 comments on commit b20487d

Please sign in to comment.