提交線圖

186 次程式碼提交

作者 SHA1 備註 日期
Evgeny Mankov adb39887b2 [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/clr commit: 8ba4acb3cd]
2018-02-08 00:08:47 +03:00
Evgeny Mankov 2a1267bd43 [HIPIFY][tests] add poisson-api-example test
+ add missing types
+ doc update


[ROCm/clr commit: eef94a74bc]
2018-01-30 19:50:18 +03:00
Evgeny Mankov ea60d1daec [HIPIFY][tests] fix typo
[ROCm/clr commit: 2ae2693c8a]
2018-01-30 18:55:09 +03:00
Evgeny Mankov 2583a716a7 [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/clr commit: 58f2d3c93f]
2018-01-29 18:33:47 +03:00
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 d88edc8874 [HIPIFY] Sync with hipBLAS ToT and CUDA cuBLAS 9.1
[ROCm/clr commit: 1ecb5b5901]
2018-01-22 17:12:02 +03:00
Evgeny Mankov 51a5587d25 [HIPIFY] cuRAND lib support (Device)
[ROCm/clr commit: 5b1b3438fd]
2018-01-19 21:29:05 +03:00
Evgeny Mankov fa4a5355e4 [HIPIFY] cuRAND lib support (partial - only Host)
[ROCm/clr commit: 2e2e38f163]
2018-01-19 17:38:51 +03:00
Evgeny Mankov aed171f87e Merge pull request #332 from emankov/cudaMap_2
[HIPIFY] Add cudaMalloc3D support

[ROCm/clr commit: a8cae9ec07]
2018-01-18 13:05:57 +03:00
Evgeny Mankov 75ed140298 [HIPIFY] Add cudaMalloc3D support
[ROCm/clr commit: eb27585136]
2018-01-18 12:28:56 +03:00
Evgeny Mankov 7bed930cd4 [HIPIFY] Add CUDA Driver API Texture Ref support (partial)
[ROCm/clr commit: 2bf8cc691b]
2018-01-18 12:03:03 +03:00
Evgeny Mankov c5c5706670 [HIPIFY] Add more supported by HIP CUDA Driver API Arrays data types and functions
[ROCm/clr commit: e2ac6c6296]
2018-01-16 21:07:50 +03:00
Evgeny Mankov d299b7c5fb Merge pull request #319 from emankov/issue_211
[HIPIFY][fix][#211] Algorithm for explicit insert of hip include directive

[ROCm/clr commit: 8f84e7a4ee]
2018-01-16 19:47:15 +03:00
Evgeny Mankov 5a369c5d29 [HIPIFY] Add more supported by HIP CUDA RT API Textures and Arrays data types
[ROCm/clr commit: 23889e7987]
2018-01-16 17:21:19 +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
emankov ed9caac587 [HIPIFY][#311][fix] Get rid of socat in run_test.sh
[ROCm/clr commit: f83df46b8c]
2018-01-15 14:20:37 +03:00
Evgeny Mankov ec693ff0d7 [HIPIFY][cmake] Version compatibility checks of CUDA and clang are added
[ROCm/clr commit: d11dccdd44]
2018-01-12 17:36:41 +03:00
Evgeny Mankov c09bed2e52 Merge pull request #307 from emankov/issue_306
[HIPIFY][FIX][#306] Eliminate second cuda main include directive

[ROCm/clr commit: 5b7d733fc1]
2018-01-10 22:50:44 +03:00
Evgeny Mankov 347cc6ec25 [HIPIFY][fix][#306] Code improve
[ROCm/clr commit: cc133b09aa]
2018-01-10 21:26:05 +03:00
Evgeny Mankov 213d425d15 [HIPIFY][#308][fix] Consume error returned by Replacements::add(...)
[ROCm/clr commit: 7b060535c0]
2018-01-09 20:03:53 +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 fecc7c74dd [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.


[ROCm/clr commit: eff6831217]
2017-12-18 19:57:04 +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
Evgeny Mankov e3e37db0d7 [HIPIFY] remove duplicates from CUDA_IDENTIFIER_MAP
[ROCm/clr commit: 43f0a14005]
2017-12-05 19:46:53 +03:00
Evgeny Mankov 2df33086a8 Merge pull request #262 from ChrisKitching/frontendaction
[HIPIFY] Mostly fix preprocessor-or-template induced issues

[ROCm/clr commit: b25d199111]
2017-11-27 17:30:11 +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
Chris Kitching e00c92d828 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...


[ROCm/clr commit: 9014c89f04]
2017-11-13 17:20:07 +00:00
Evgeny Mankov 2386c75b98 [HIPIFY] fix typo - missing )
[ROCm/clr commit: a469e785f2]
2017-10-27 23:31:43 +03:00
Evgeny Mankov d93bad141c Merge pull request #238 from ChrisKitching/statistics
[HIPIFY] Decouple the statistics system from the code rewriter

[ROCm/clr commit: 5e5ef3e3f4]
2017-10-27 23:17:20 +03:00
Evgeny Mankov 408839fc1c Merge pull request #236 from ChrisKitching/friendlyCmake
[HIPIFY] Make the cmake build system more friendly

[ROCm/clr commit: f19fcb7a42]
2017-10-27 22:35:13 +03:00
Chris Kitching eaa48e16c3 Remove commented else-block
A warning statement for _string literals_ seems a bit unhelpful.
There's no value in this being here.


[ROCm/clr commit: ec2a6ba446]
2017-10-27 20:12:33 +01:00
Chris Kitching 4e6ca773fa 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).


[ROCm/clr commit: dd5a60054a]
2017-10-27 20:12:33 +01:00
Chris Kitching c6bc4f5249 Copy-paste less in the statistics printing code
[ROCm/clr commit: 5365a8638f]
2017-10-27 20:12:33 +01:00
Chris Kitching e9b8afaaeb Inline updateCountersExt
[ROCm/clr commit: 69d2555f17]
2017-10-27 20:12:32 +01:00
Chris Kitching 0b45e8d905 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.


[ROCm/clr commit: cecc0782ef]
2017-10-27 20:12:32 +01:00
Chris Kitching b89133c2d4 Prefer references to pointers in updateCountersExt()
[ROCm/clr commit: 828552decb]
2017-10-27 20:12:32 +01:00
Chris Kitching f659ad0eeb Move string utility functions into their own translation unit
[ROCm/clr commit: ab824ebd47]
2017-10-27 20:12:32 +01:00
Chris Kitching dcd770f25a Extract LLVM compatibility code into its own translation unit
[ROCm/clr commit: 9478be8198]
2017-10-27 20:12:32 +01:00
Chris Kitching 43b9ce8b56 Remove unused field
[ROCm/clr commit: 9eeac22359]
2017-10-27 20:12:32 +01:00
Chris Kitching 3d0f71e803 Remove CUDA_EXCLUDES
An artefact from a now-defunct hack to avoid corrupting programs


[ROCm/clr commit: 51df93cf25]
2017-10-27 20:12:32 +01:00
Chris Kitching cf14905f11 Make unsupported actually be a bool...
[ROCm/clr commit: 417fc92482]
2017-10-27 20:12:31 +01:00
Chris Kitching 57c7a33674 Describe the LLVM we found
[ROCm/clr commit: c909c00494]
2017-10-27 19:39:41 +01:00
Chris Kitching ae21f6400c Update hipify-clang readme for simplified build process
[ROCm/clr commit: f25afde2f5]
2017-10-27 19:39:41 +01:00
Chris Kitching 4e924460b4 hipify does not add the hipLaunchParm option any more
This was removed a while ago - seems like it uses a different
variant of the launch kernel function now, so this is redundant.


[ROCm/clr commit: 47c8293eaf]
2017-10-27 19:39:41 +01:00
Chris Kitching 8f59de9d2b Use cmake's builtin mechanism for handling library locations
See [the documentation](https://cmake.org/cmake/help/v3.0/command/find_package.html)
for exactly how the search procedure works. If you want to use an
LLVM from a specific location, use CMAKE_PREFIX_PATH as normal.

No longer do we have a nonstandard HIPIFY_CLANG_LLVM_DIR variable
for people to learn about.


[ROCm/clr commit: de8dcf0ed2]
2017-10-27 19:39:40 +01:00