Граф коммитов

23 Коммитов

Автор SHA1 Сообщение Дата
Evgeny Mankov 517ba1c4c1 [HIPIFY][LLVMCompat] support of upcoming LLVM 8.0
+ StringRef issue, which is finally moved to LLVM from Clang
+ Renamed getBeginLoc() and getEndLoc() resolution for Expr and TypeLoc classes
+ Support all the previous LLVM versions via LLVCompat


[ROCm/hip commit: aad5858cb1]
2018-11-16 01:23:25 +03:00
Evgeny Mankov 96fefc34b4 [HIPIFY][fix][#739] Fix garbage after replacements
[Issue] https://github.com/ROCm-Developer-Tools/HIP/issues/739
[Resolution] Always use an std::string not a clang::StringRef for replacement

P.S. Occurred only on Linux, on Windows works fine.


[ROCm/hip commit: a8e6033aa3]
2018-10-30 19:35:59 +03:00
Evgeny Mankov 7470b5b694 [HIPIFY] Modify HIP types to conform to CUDA's ones
[ROCm/hip commit: f83eabfa9e]
2018-10-29 20:51:25 +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 37d047b454 [HIPIFY][Complex] Add cuComplex support
+ Add API_COMPLEX support (data types and functions)
+ Add cuComplex_API_supported_by_HIP.md
+ Add cuComplex_Julia.cu test
+ Update README.md


[ROCm/hip commit: 368977f75b]
2018-08-08 18:34:57 +03:00
Evgeny Mankov 2122770861 [HIPIFY][FFT] Add cuFFT support
+ Add API_FFT support (data types and functions)
+ Add CUFFT_API_supported_by_HIP.md
+ Add simple_cufft.cu test
+ Update README.md


[ROCm/hip commit: 70cfa5e53c]
2018-07-31 22:25:48 +03:00
Evgeny Mankov 51fff4049a [HIPIFY] Current trunk LLVM 7.0 initial support
Tested with CUDA 8.0, 9.0, 9.1 and 9.2.

Only 8.0 works with LLVM 7.0, due to the changes in LLVM trunc since released 6.0, which works fine with CUDA 8.0 and 9.0.

So, nothing to do in hipify-clang, hope that all the CUDA 9.x related issues will be fixed in 7.0 release.


[ROCm/hip commit: 433e172776]
2018-07-11 20:15:49 +03:00
Evgeny Mankov 057b13fc4a [HIPIFY] Initial cuDNN support
- based on https://github.com/ROCmSoftwarePlatform/hipDNN.
- lit testing was supplemented with CUDA_DNN_ROOT_DIR for cuDNN testing.
- single cuDNN test was added.


[ROCm/hip commit: fe421c89b2]
2018-05-03 11:33:40 +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 e455192444 [HIPIFY] InclusionDirective refactoring
Due to support of cuRAND headers.

+ compound test on all headers is added;
+ missing entities are added with updating the doc;
+ a couple cuRAND tests are added (https://github.com/ROCmSoftwarePlatform/rocRAND/tree/master/benchmark):
  - the following CUDA entities are still unsupported by hipRAND:
      curandMakeMTGP32Constants
      curandMakeMTGP32KernelState
      curandGetDirectionVectors32
      curandDirectionVectorSet_t
      CURAND_DIRECTION_VECTORS_32_JOEKUO6
      curandStateSobol64_t
      curandStateScrambledSobol64_t
      curandGenerateLongLong
  - and the following - by HIP:
      cudaRuntimeGetVersion
  - those entities are handled by CHECK-NOT directive for now.


[ROCm/hip commit: 02e23c4d87]
2018-01-29 18:33:47 +03:00
Evgeny Mankov 496111adc3 Merge pull request #340 from emankov/master
[HIPIFY][fix] Fix PragmaDirective

[ROCm/hip commit: fb1012a4b8]
2018-01-24 18:09:54 +03:00
Evgeny Mankov 369f3aa9fa [HIPIFY][fix] CUDA and cuBLAS main headers correct handling
[ROCm/hip commit: 600d5d7c06]
2018-01-23 23:43:36 +03:00
Evgeny Mankov fda3893ee3 [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/hip commit: 77f807b597]
2018-01-23 23:06:55 +03:00
Evgeny Mankov e09ba44b16 Update HipifyAction.cpp
dead code eliminate

[ROCm/hip commit: e54d9f3df0]
2018-01-16 15:08:08 +03:00
Evgeny Mankov 0e8da085bf [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/hip commit: 09655a0853]
2018-01-15 21:05:05 +03:00
Evgeny Mankov 217d7031a4 [HIPIFY][fix][#306] Code improve
[ROCm/hip commit: 08662fba73]
2018-01-10 21:26:05 +03:00
Evgeny Mankov 263cacc1c2 [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/hip commit: 7e7cfa10cc]
2017-12-26 20:54:54 +03:00
Evgeny Mankov 3233d633da [HIPIFY] Remove cudaBuiltin matcher
[ROCm/hip commit: 5d92a6c252]
2017-12-06 20:22:14 +03:00
Evgeny Mankov eefead5a1c [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/hip commit: 71d2fb20c8]
2017-12-05 20:28:51 +03:00
Chris Kitching 096136750c 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/hip commit: 6b767a59ba]
2017-11-13 20:58:55 +00: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