커밋 그래프

31 커밋

작성자 SHA1 메시지 날짜
Evgeny Mankov cabe0bb799 [HIPIFY][python] Initial support of hipify-python generation from hipify-clang
+ Only a generation of transformation map of CUDA entities is implemented.
+ 2 hipify-clang options are added: -python, -o-python-map-dir.
+ Explicitly set -roc option for cuda_to_hip_mappings.py generation.
+ Generated file already might be used by pytorch team.


[ROCm/hip commit: 6b370e7743]
2019-05-08 19:08:55 +03:00
Evgeny Mankov aea6e34875 [HIPIFY][perl] Support of hipify-perl generation from hipify-clang: next steps
+ Generate transformation map sorted by entity type.
+ Add a generation of supported header files.


[ROCm/hip commit: 9ddc316fa7]
2019-05-08 15:25:06 +03:00
Evgeny Mankov b66ecc6596 [HIPIFY][perl] Initial support of hipify-perl generation from hipify-clang
+ Only a generation of transformation map of CUDA entities supported by HIP is implemented.
+ 3 hipify-clang options are added: -perl, -o-perl-map, -o-perl-map-dir.
+ OptionsParser mode is changed from OneOrMore to Optional to support hipify-perl generation without actual hipification.
+ Add explicit control of source files specification absence in case of no perl generation.


[ROCm/hip commit: 5a3d33a338]
2019-05-07 17:27:34 +03:00
Evgeny Mankov d51679ed8e [HIPIFY][fix][#204] Suppress warning message: #pragma once in main file
[ROCm/hip commit: 6d3c443234]
2019-04-24 20:35:52 +03:00
Evgeny Mankov 0ebdc54f79 [HIPIFY] Introduce Verbose '-v' option as hipify's own
[ROCm/hip commit: ce28bc79ef]
2019-01-30 15:19:06 +03:00
Evgeny Mankov 6789cec88f [HIPIFY][fix][#867] Relative paths routines fixes and improvements
+ Always check for existence any file or dir, first of all, because real_path and make_absolute differ: real_path additionally performs access on file/dir.
+ Relative path routines in source files implemented similarly to dirs.
+ Error handling improvements.


[ROCm/hip commit: 1be38618e2]
2019-01-16 19:30:09 +03:00
Evgeny Mankov 2f5951d54c [HIPIFY] rename variables as requested in review
[ROCm/hip commit: e6c09bb9af]
2019-01-14 21:19:34 +03:00
Evgeny Mankov 225a0f3310 [HIPIFY] Introduce '-D' option as hipify-clang's one
+ '-D' might be set as hipify-clang option (before separator '--' or without specifying separator at all);
+ '-D' as a clang option might be specified as well (after options separator '--');
+ All defines specified as hipify-clang defines (before options separator '--') will be set after clang's ones and will redefine the same clang's ones.


[ROCm/hip commit: 13ffeb47ce]
2019-01-14 19:34:42 +03:00
Evgeny Mankov 937d78963b [HIPIFY] Introduce '-I' option as hipify-clang's one
+ '-I' might be set as hipify-clang option (before separator '--' or without specifying separator at all);
+ '-I' as a clang option might be specified as well (after options separator '--').


[ROCm/hip commit: 93aeb04cec]
2019-01-14 18:23:54 +03:00
Evgeny Mankov 3792d264c0 [HIPIFY] Introduce '--' option - a separator between hipify-clang and clang options
+ Append '--' to the end of hipify-clang options in case of its absence.

[Reason]
+ Avoid the necessity for the user in JSON compilation database specification.
  Otherwise:
  Error while trying to load a compilation database:
  Could not auto-detect compilation database for file "test.cu"

  Though the hipification will be performed correctly without JSON database.


[ROCm/hip commit: aa4c59ae0c]
2019-01-10 18:27:30 +03:00
Evgeny Mankov 6acede94f5 [HIPIFY] Introduce CUDA installation path option '-cuda-path'
Repeats clang's '--cuda-path' option.

[Reason]
In case of absence of any other clang's options setting '-cuda-path' allows not to specify separator '--' before clang's '--cuda-path'.

+ Tests and scripts are updated accordingly.


[ROCm/hip commit: fbfe005e4e]
2019-01-09 20:18:36 +03:00
emankov 60adc94cad [HIPIFY][fix][#849] Create temporary file based on source file name only
[ROCm/hip commit: 4a475a9db6]
2019-01-05 14:52:15 +03:00
emankov dc9f785152 [HIPIFY][fix] Change system includes order
'include/cuda_wrappers' should go first.


[ROCm/hip commit: c09022232a]
2018-12-29 22:10:00 +03:00
emankov 01a335b975 [HIPIFY] Add system includes for packaged hipify-clang to use it without the necessity of installing clang
Header files in those dirs are an integral part of clang, which includes wrapper headers for CUDA.
There is no need in checking those dirs.

[Reasons]
1. clang will not take into account empty or irrelevant include dirs;
2. Packages for different clang versions will have different header files in the above dirs.


[ROCm/hip commit: c519c89abf]
2018-12-29 21:53:18 +03:00
emankov 4e50eba101 [HIPIFY] Starts implicitly setting '-x cuda' by hipify-clang itself
+ No need in setting '-x cuda' for the user anymore;
+ Testing and Readme updated accordingly.


[ROCm/hip commit: 7ea586c323]
2018-12-29 17:04:59 +03:00
emankov d6593e4138 [HIPIFY][win] Set -std=c++14 if MSVC
+ Due to latest Windows SDK implementation based on c++14 features, '-std+c++14' is a must;
+ Doesn't affect older versions of MSVC 2017, 2015 (the latest supported is MSVC 2015);
+ On linux still '-std=c++11' is a must;
+ Exclude '-std=' from lit config.


[ROCm/hip commit: 2d3f62c3e1]
2018-12-29 15:51:06 +03:00
emankov 279550644e [HIPIFY] LLVM compatibility
+ sys::fs::make_absolute fro LLVM < 5.0
+ sys::fs::real_path for LLVM >= 5.0


[ROCm/hip commit: 208d7cfaf1]
2018-12-28 01:34:35 +03:00
emankov eb90a74c3e [HIPIFY] Use sys::fs::createTemporaryFile without file creation
[Reasons]
+ File is opened further by clang
+ There is a regression with LLVM 5.x, when system error occurs: temporary file couldn't be renamed - permission denied.


[ROCm/hip commit: 912c4710ed]
2018-12-27 17:00:18 +03:00
emankov 708367f299 [HIPIFY] Introduce option -o-dir
Option -o-dir for output directory:
  + if not specified source file(s) directory is used;
  + creates the directory if the directory doesn't exist (only one level in a tree);
  + if -o and -o-dir both are specified the hipified file is placed to "-o-dir" + "-o";
  + reports an error in case of a wrong directory specified, in case of necessity of creating a tree of subfolders, or in case of a filename specified.


[ROCm/hip commit: c8d720081f]
2018-12-26 16:30:41 +03:00
emankov f8f00472f8 [HIPIFY][#812] Finishing with temps
1. Option -temp-dir for temporary directory:
  + if not specified system temp is used;
  + creates the directory if the directory doesn't exist (only one level in a tree);
  + reports an error in case of a wrong directory specified, in case of necessity of creating a tree of subfolders, or in case of a filename specified.
2. Option -save-temps for preserving temporary files:
  + if specified temporary files are not being deleted from system temps and user temps as well.
3. Work with files in terms of calculated absolute paths by collapsing all '.' and '..' patterns, resolving symlinks and expanding '~' expression to the user's home directory:
  + to produce correct include paths;
  + to avoid possible errors on file routines.


[ROCm/hip commit: cc59af5dbd]
2018-12-22 00:47:19 +03:00
emankov 41901c007e [HIPIFY][fix][#824] Fix the bug with -inplace option
+ Do temp file copying instead of renaming
+ Replace all file routine functions with LLVM's
+ Do not output hipified file in case of errors


[ROCm/hip commit: 8bf3b42e7e]
2018-12-20 20:43:50 +03:00
emankov 13126143ed [HIPIFY] Add the legal right comment to all the sources
[ROCm/hip commit: fcaf954998]
2018-12-20 18:47:57 +03:00
Evgeny Mankov c0c5fbf0b7 [HIPIFY] Temporary files in system temps introducing
+ Files are not being placed near original source before hipification anymore, system tmp is used for them now.
+ Additional include (-I) to absolute original source dir is added
+ Partially implements #812
+ Tested on windows/linux, single/multiple inputs, with and without includes to user header files


[ROCm/hip commit: da6fdc0397]
2018-12-17 20:48:48 +03:00
Evgeny Mankov 13faaec7b5 [HIPIFY][fix] Fixer for #801
[issue #801] Errors in hipification statistics


[ROCm/hip commit: 9d223f0f65]
2018-12-12 21:33:00 +03:00
Evgeny Mankov 0fef14487c [HIPIFY] Split CUDA2HIP map into a number of maps based on API type
[Reasons]
+ Simplify the support
+ Optimize compilation and code generation time

[Additionally]
+ Update minimum required version of cmake
+ Fix MSVC compile options force update


[ROCm/hip commit: 5d1255272b]
2018-10-23 00:00:10 +03:00
Evgeny Mankov 5b192ed119 [HIPIFY] Code cleanup and formatting
[ROCm/hip commit: ee3a5cc722]
2018-10-15 15:27:37 +03:00
Evgeny Mankov 2c8fbf1a67 [HIPIFY] Add DEBUG(X) macro compatibility
In LLVM 7.0 DEBUG(X) was deleted, LLVM_DEBUG(X) should be used instead.


[ROCm/hip commit: 9fcb48e5c4]
2018-07-11 18:21:00 +03:00
Evgeny Mankov 540fc92b1c [HIPIFY] undo apply .clangformat to HIPIFY source files
[ROCm/hip commit: 8499e79e2b]
2018-04-23 20:22:15 +03:00
Maneesh Gupta 4f42ee762d Apply .clangformat to all repo source files
Change-Id: I7e79c6058f0303f9a98911e3b7dd2e8596079344


[ROCm/hip commit: 1ba06f63c4]
2018-03-12 11:29:03 +05:30
Evgeny Mankov 1b25dfa25c [HIPIFY][fix] Build against llvm 3.8.0 fixed - missing include
/srv/HIP/hipify-clang/src/main.cpp:134:19: error: no member named 'dbgs' in namespace 'llvm'
      DEBUG(llvm::dbgs() << "Skipped some replacements.\n");
            ~~~~~~^


[ROCm/hip commit: 7f3e89bbb0]
2018-02-08 00:08:47 +03:00
Chris Kitching 78cf713140 Use a custom FrontendAction to simplify identifier translation
Most of what hipify does is really just replacing CUDA idenitifers
with HIP ones. CUDA function calls, preprocessor macro calls,
enum references, types, etc.

This is problematic: calls/types/enum-refs require name resolution
for the AST matcher to work. This fails in the presence of code
deleted by the preprocessor, and in two-pass template compilation.

Instead, we can simply hook the lexer and have it rewrite the
identifiers for us.

This approach means identifier transformations will work correctly
regardless of where they appear (and we get to delete lots of code)

- Fixes #260
- Helps a bit with #207 - it will still fail to translate kernel
calls in preprocessor-ignored code, but everything except kerel
launches should translate correctly now, even in
preprocessor-deleted code.


[ROCm/hip commit: 24cdc5e1d3]
2017-11-13 20:58:54 +00:00