Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use clang++ from HIP SDK on Windows as a C++ compiler #2815

Merged
merged 26 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5c9a5f1
use clang++ from HIP SDK on Windows as a C++ compiler
apwojcik Feb 22, 2024
74f8678
Merge branch 'develop' into compile_src
apwojcik Feb 22, 2024
0140634
use fs::path instead of std::string
apwojcik Feb 22, 2024
50753f0
fix clang-format
apwojcik Feb 22, 2024
8b362fd
fix compilation after changing to fs::path
apwojcik Feb 22, 2024
9ffbe14
add path_value_of to env
apwojcik Feb 22, 2024
27ab5ea
update the year in the license
apwojcik Feb 22, 2024
ba8f481
Merge branch 'develop' into compile_src
apwojcik Feb 22, 2024
7f94562
update the year in the license
apwojcik Feb 22, 2024
51236ae
move WIN32 part to compile_src.cpp
apwojcik Feb 22, 2024
e4d0b03
fix clang-format
apwojcik Feb 22, 2024
b139026
Merge branch 'develop' into compile_src
apwojcik Feb 23, 2024
4f50d12
Merge branch 'develop' into compile_src
apwojcik Feb 26, 2024
e0b7d6d
incorporate review feedback
apwojcik Feb 27, 2024
85603ed
fix env.hpp date
apwojcik Feb 27, 2024
2028b4c
fix licence date
apwojcik Feb 27, 2024
bf9ac09
fix licence date
apwojcik Feb 27, 2024
af77e1b
Merge branch 'develop' into compile_src
apwojcik Feb 27, 2024
e246d89
Merge branch 'develop' into compile_src
apwojcik Mar 1, 2024
ccbf0ef
Merge branch 'develop' into compile_src
apwojcik Mar 4, 2024
342d12d
fix compilation after merging 'develop' branch
apwojcik Mar 4, 2024
cab10ff
fix clang-format
apwojcik Mar 4, 2024
4938d9b
Merge branch 'develop' into compile_src
apwojcik Mar 4, 2024
b3614a4
Merge branch 'develop' into compile_src
apwojcik Mar 6, 2024
1ce1274
Merge branch 'develop' into compile_src
apwojcik Mar 7, 2024
3d08615
Merge branch 'develop' into compile_src
causten Mar 12, 2024
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
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ if(BUILD_DEV)
target_compile_definitions(migraphx PUBLIC -DBUILD_DEV)
endif()

target_compile_definitions(migraphx PUBLIC MIGRAPHX_CXX_COMPILER="${CMAKE_CXX_COMPILER}")

rocm_export_targets(
TARGETS migraphx::migraphx_c
NAMESPACE migraphx::
Expand Down
2 changes: 1 addition & 1 deletion src/compile_src.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

std::vector<std::string> args;
if(not launcher.empty())
args.push_back(compiler);
args.push_back(compiler.string());

Check warning on line 64 in src/compile_src.cpp

View check run for this annotation

Codecov / codecov/patch

src/compile_src.cpp#L64

Added line #L64 was not covered by tests
args.insert(args.end(), params.begin(), params.end());
td.execute(launcher.empty() ? compiler : launcher, args);

Expand Down
4 changes: 2 additions & 2 deletions src/include/migraphx/compile_src.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ struct src_file

struct MIGRAPHX_EXPORT src_compiler
{
std::string compiler = "c++";
fs::path compiler = MIGRAPHX_CXX_COMPILER;
std::vector<std::string> flags = {};
fs::path output = {};
std::string launcher = "";
fs::path launcher = {};
std::string out_ext = ".o";
std::function<fs::path(fs::path)> process = nullptr;
std::vector<char> compile(const std::vector<src_file>& srcs) const;
Expand Down
4 changes: 4 additions & 0 deletions src/include/migraphx/tmp_dir.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ struct MIGRAPHX_EXPORT tmp_dir
tmp_dir(tmp_dir&&) = default;

void execute(std::string_view cmd, const std::vector<std::string>& args = {}) const;
void execute(const fs::path& cmd, const std::vector<std::string>& args = {}) const
{
execute(std::string_view{cmd.string()}, args);
}

tmp_dir(tmp_dir const&) = delete;
tmp_dir& operator=(tmp_dir const&) = delete;
Expand Down
2 changes: 2 additions & 0 deletions src/targets/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ else()
endif()
endif()

target_compile_definitions(migraphx_gpu PUBLIC MIGRAPHX_CXX_COMPILER="${CMAKE_CXX_COMPILER}")

# Check miopen find mode api

include(CheckLibraryExists)
Expand Down
Loading