Commit Graph

196 Commits

Author SHA1 Message Date
Evgeny Mankov a5df3a484c [HIPIFY][DNN] support of cuDNN 7.1.3 - finishing 2018-05-21 18:31:20 +03:00
Evgeny Mankov b0fd0c310d [HIPIFY][DNN] support of cuDNN 7.1.3 - continuation 2
- not finished yet.
- based on https://github.com/ROCmSoftwarePlatform/hipDNN.
- testing on https://github.com/baidu-research/DeepBench - almost pass, except cusparse (not supported yet).
- started testing of examples from libcudnn7-dev_7.1.3.16-1+cuda8.0_amd64 package.
2018-05-14 16:23:59 +03:00
Evgeny Mankov dffe1802be [HIPIFY][DNN] support of cuDNN 7.1.3 - continuation
- not finished yet.
- based on https://github.com/ROCmSoftwarePlatform/hipDNN.
- testing on https://github.com/baidu-research/DeepBench.
2018-05-10 17:36:51 +03:00
Evgeny Mankov e5ba9668fc [HIPIFY][Blas] Sync with CUDA 9.1 2018-05-08 20:42:30 +03:00
Evgeny Mankov 7681775662 [HIPIFY] Sync with hipBLAS 2018-05-08 19:20:47 +03:00
Evgeny Mankov 054c3f71f0 [HIPIFY][doc] Readme.md update
+ supported CUDA version to LLVM version correspondence table is added.
+ Test section is rewritten.
+ Windows support is added.
2018-05-04 10:50:18 +03:00
Evgeny Mankov fe421c89b2 [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.
2018-05-03 11:33:40 +03:00
Evgeny Mankov 6f501f6094 [HIPIFY] Sync with HIP (Execution Control, Surfaces, Memory)
Execution Control [deprecated since 7.0]:
cudaConfigureCall -> hipConfigureCall
cudaLaunch -> hipLaunchByPtr
cudaSetupArgument -> hipSetupArgument

Surfaces (partially):
cudaSurfaceObject_t -> hipSurfaceObject_t
cudaSurfaceBoundaryMode -> hipSurfaceBoundaryMode
cudaCreateSurfaceObject -> hipCreateSurfaceObject
cudaDestroySurfaceObject -> hipDestroySurfaceObject

Memory Management:
cudaMemset2DAsync -> hipMemset2DAsync
2018-04-24 22:04:04 +03:00
Evgeny Mankov 8499e79e2b [HIPIFY] undo apply .clangformat to HIPIFY source files 2018-04-23 20:22:15 +03:00
Maneesh Gupta 1ba06f63c4 Apply .clangformat to all repo source files
Change-Id: I7e79c6058f0303f9a98911e3b7dd2e8596079344
2018-03-12 11:29:03 +05:30
Evgeny Mankov 7f3e89bbb0 [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");
            ~~~~~~^
2018-02-08 00:08:47 +03:00
Evgeny Mankov 26095fe7c1 [HIPIFY][tests] add poisson-api-example test
+ add missing types
+ doc update
2018-01-30 19:50:18 +03:00
Evgeny Mankov 9d814bef31 [HIPIFY][tests] fix typo 2018-01-30 18:55:09 +03:00
Evgeny Mankov 02e23c4d87 [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.
2018-01-29 18:33:47 +03:00
Evgeny Mankov fb1012a4b8 Merge pull request #340 from emankov/master
[HIPIFY][fix] Fix PragmaDirective
2018-01-24 18:09:54 +03:00
Evgeny Mankov 600d5d7c06 [HIPIFY][fix] CUDA and cuBLAS main headers correct handling 2018-01-23 23:43:36 +03:00
Evgeny Mankov 77f807b597 [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.
2018-01-23 23:06:55 +03:00
Evgeny Mankov ddfb110080 [HIPIFY] Sync with hipBLAS ToT and CUDA cuBLAS 9.1 2018-01-22 17:12:02 +03:00
Evgeny Mankov 6e000adde4 [HIPIFY] cuRAND lib support (Device) 2018-01-19 21:29:05 +03:00
Evgeny Mankov 8ff99eeadc [HIPIFY] cuRAND lib support (partial - only Host) 2018-01-19 17:38:51 +03:00
Evgeny Mankov 0f7d687271 Merge pull request #332 from emankov/cudaMap_2
[HIPIFY] Add cudaMalloc3D support
2018-01-18 13:05:57 +03:00
Evgeny Mankov ff5f964c07 [HIPIFY] Add cudaMalloc3D support 2018-01-18 12:28:56 +03:00
Evgeny Mankov 5788ac5d37 [HIPIFY] Add CUDA Driver API Texture Ref support (partial) 2018-01-18 12:03:03 +03:00
Evgeny Mankov 478fed74fe [HIPIFY] Add more supported by HIP CUDA Driver API Arrays data types and functions 2018-01-16 21:07:50 +03:00
Evgeny Mankov 88c5ffee3a Merge pull request #319 from emankov/issue_211
[HIPIFY][fix][#211] Algorithm for explicit insert of hip include directive
2018-01-16 19:47:15 +03:00
Evgeny Mankov eb61038736 [HIPIFY] Add more supported by HIP CUDA RT API Textures and Arrays data types 2018-01-16 17:21:19 +03:00
Evgeny Mankov e54d9f3df0 Update HipifyAction.cpp
dead code eliminate
2018-01-16 15:08:08 +03:00
Evgeny Mankov 09655a0853 [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.
2018-01-15 21:05:05 +03:00
emankov 6500cce6aa [HIPIFY][#311][fix] Get rid of socat in run_test.sh 2018-01-15 14:20:37 +03:00
Evgeny Mankov caf6b5c4f0 [HIPIFY][cmake] Version compatibility checks of CUDA and clang are added 2018-01-12 17:36:41 +03:00
Evgeny Mankov f19cb9995e Merge pull request #307 from emankov/issue_306
[HIPIFY][FIX][#306] Eliminate second cuda main include directive
2018-01-10 22:50:44 +03:00
Evgeny Mankov 08662fba73 [HIPIFY][fix][#306] Code improve 2018-01-10 21:26:05 +03:00
Evgeny Mankov 3f6de8bb10 [HIPIFY][#308][fix] Consume error returned by Replacements::add(...) 2018-01-09 20:03:53 +03:00
Evgeny Mankov 7e7cfa10cc [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.
2017-12-26 20:54:54 +03:00
Evgeny Mankov 56bffb5999 [HIPIFY][cmake] Fix require_program function
Function require_program erroneously doesn't report "Can't find program" on any missing program except the first one due to the cached FOUND_PROGRAM value.

Additionally:
+ Do not throw FATAL_ERROR on missing program in order to obtain the whole list of missing programs (if any).
+ Report also found program location.
2017-12-18 19:57:04 +03:00
Evgeny Mankov 5d92a6c252 [HIPIFY] Remove cudaBuiltin matcher 2017-12-06 20:22:14 +03:00
Evgeny Mankov 71d2fb20c8 [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.
2017-12-05 20:28:51 +03:00
Evgeny Mankov f24dfc6f36 [HIPIFY] remove duplicates from CUDA_IDENTIFIER_MAP 2017-12-05 19:46:53 +03:00
Evgeny Mankov aa05b3d84e Merge pull request #262 from ChrisKitching/frontendaction
[HIPIFY] Mostly fix preprocessor-or-template induced issues
2017-11-27 17:30:11 +03:00
Chris Kitching 6b767a59ba 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.
2017-11-13 20:58:55 +00:00
Chris Kitching 24cdc5e1d3 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.
2017-11-13 20:58:54 +00:00
Chris Kitching 23b5d26582 Add hipify mappings for all CUDA headers that have HIP equivalents
I'm particularly running into issues with `device_types.h` in real
CUDA code...
2017-11-13 17:20:07 +00:00
Evgeny Mankov 44c74b6511 [HIPIFY] fix typo - missing ) 2017-10-27 23:31:43 +03:00
Evgeny Mankov b28a69785b Merge pull request #238 from ChrisKitching/statistics
[HIPIFY] Decouple the statistics system from the code rewriter
2017-10-27 23:17:20 +03:00
Evgeny Mankov c9b7c43e1c Merge pull request #236 from ChrisKitching/friendlyCmake
[HIPIFY] Make the cmake build system more friendly
2017-10-27 22:35:13 +03:00
Chris Kitching 20871a3a07 Remove commented else-block
A warning statement for _string literals_ seems a bit unhelpful.
There's no value in this being here.
2017-10-27 20:12:33 +01:00
Chris Kitching b303ffe53e Decouple the statistics system from the code translation
The original implementation had the statistics system woken very
tightly into things like PPCallbacks, with counters duplicated
in two places, and all the output code duplicated. This made it
very difficult to alter the structure of the program without
breaking the statistics system.

Since the planned approach for solving the remaining preprocessor
bugs needs the introduction of a custom FrontendAction, and such
a restructure was incompatible with the way the statistics system
was set up, this rewrite was required.

'tis rather simpler now, mind you :D

This commit also fixes an issue where some stats were counted
twice, and allows `-print-stats` to operate independently of
`-stat-output`, allowing you to print stats to a file without
printing them to a terminal (or vice-versa).
2017-10-27 20:12:33 +01:00
Chris Kitching 5699c18adc Copy-paste less in the statistics printing code 2017-10-27 20:12:33 +01:00
Chris Kitching 50448aec3b Inline updateCountersExt 2017-10-27 20:12:32 +01:00
Chris Kitching d8beee8918 Update counter maps sanely
operator[] default-constructs the map value if no value exists
for that key. Default-construction of int yields a zero. So all
the manual faffing around is just unnecessary.
2017-10-27 20:12:32 +01:00