提交線圖

11 次程式碼提交

作者 SHA1 備註 日期
Evgeny Mankov 278ae56dfe Merge pull request #340 from emankov/master
[HIPIFY][fix] Fix PragmaDirective

[ROCm/clr commit: 657be80c29]
2018-01-24 18:09:54 +03:00
Evgeny Mankov cbbf54d122 [HIPIFY][fix] CUDA and cuBLAS main headers correct handling
[ROCm/clr commit: aaa9559768]
2018-01-23 23:43:36 +03:00
Evgeny Mankov d3d192e62c [HIPIFY][fix] Fix PragmaDirective
File location have to be verified, otherwise location of the first found '#pragma once' in any included header even system will be erroneously handled, which might lead to attempt to including hip_runtime.h in it.


[ROCm/clr commit: b9fc653b08]
2018-01-23 23:06:55 +03:00
Evgeny Mankov 38c69ecb73 Update HipifyAction.cpp
dead code eliminate

[ROCm/clr commit: a26e323612]
2018-01-16 15:08:08 +03:00
Evgeny Mankov 36b0e4003e [HIPIFY][fix][#211] Algorithm for explicit insert of hip include directive
If in source CUDA file main header (cuda_runtime.h or cuda.h) is not presented, corresponding HIP main header (hip_runtime.h) should be explicitly included in output hipified file.

[Algorithm]
1. If #pragma once is presented, HIP main header should be placed just after it;
2. Otherwise if any other (not CUDA main) header is presented, HIP main header should be placed just before it;
3. Otherwise HIP main header should be placed in the beginning of output file.

P.S.
There might be one more situation when #ifndef #define ... #endif guard for the entire file is presented (make sense for *.h, *.hpp, *.cuh files). In this case HIP main include should be placed just after such #ifdef, or after #pragma once, if it is also presented. This situation will be handled in a separate change.


[ROCm/clr commit: e90a76a1ef]
2018-01-15 21:05:05 +03:00
Evgeny Mankov 347cc6ec25 [HIPIFY][fix][#306] Code improve
[ROCm/clr commit: cc133b09aa]
2018-01-10 21:26:05 +03:00
Evgeny Mankov 178554cfef [HIPIFY][FIX][#306] Eliminate second cuda main include directive
// hipified to #include<hip/hip_runtime.h>
#include<cuda.h> // 1st cuda main include (Driver API)
// to eliminate
#include<cuda_runtime.h> // 2nd cuda main include (Runtime API)

HIP has one header hip_runtime.h for both CUDA APIs, thus second cuda main include directive is eliminated entirely.


[ROCm/clr commit: 5a45d3ca84]
2017-12-26 20:54:54 +03:00
Evgeny Mankov b56bc8a1c7 [HIPIFY] Remove cudaBuiltin matcher
[ROCm/clr commit: 45befb73d3]
2017-12-06 20:22:14 +03:00
Evgeny Mankov d8f8cc2838 [HIPIFY] Disable cudaBuiltin matcher.
As HIP has started to support vanilla CUDA syntax for threadIdx, blockIdx, blockDim and gridDim.
Other CUDA builtins are not tracked for now.


[ROCm/clr commit: ccc959fdc9]
2017-12-05 20:28:51 +03:00
Chris Kitching 83e450e2c7 Use proper clang diagnostics for printing warnings
Much pretty. Very wow

This gives users all the usual power when it comes to manipulating
clang diagnostics. People can pass -Werror can have hipify fail if
it doesn't completely translate a file, for example. Much nicer
than reinventing the wheel.


[ROCm/clr commit: 506deca07f]
2017-11-13 20:58:55 +00:00
Chris Kitching 842c8c28d7 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/clr commit: 7a441aef10]
2017-11-13 20:58:54 +00:00