Commit Graph

22 Commits

Author SHA1 Message Date
Evgeny Mankov 6974aca85f [HIPIFY] undo apply .clangformat to HIPIFY source files
[ROCm/clr commit: ad28f72ca9]
2018-04-23 20:22:15 +03:00
Maneesh Gupta 46ddefedee Apply .clangformat to all repo source files
Change-Id: I7e79c6058f0303f9a98911e3b7dd2e8596079344


[ROCm/clr commit: 9e47fccc89]
2018-03-12 11:29:03 +05:30
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 cbbf54d122 [HIPIFY][fix] CUDA and cuBLAS main headers correct handling
[ROCm/clr commit: aaa9559768]
2018-01-23 23:43:36 +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 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 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 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
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 4d23fb75e9 Split the giant lookup table into 3 smaller ones
Instead of having a single, enormous LUT for all CUDA names, let's
have separate ones for different types of entity. We often know
that we're looking at a typename, or a function name, or a macro
name - so we can be more efficient (and resilient to name
collisions) by having smaller lookup tables for each of those
classes of entity).

Here we start that off by having three LUTs:
- Header names
- Type names
- Everything else

Future work could usefully split "everything else" into:
- enum values
- macro names
- function names
- everything else

It's worth noting that the "needs new matcher" todos I delete here
were actually resolved with the previous commit. It no longer
naively searches for things that start with "cu*" - it will find
exactly those things that are present in our lookup tables.


[ROCm/clr commit: 9da456b315]
2017-10-24 20:38:49 +01:00
Chris Kitching bbac7c8b82 Move giant lookup table into another translation unit
Also, rewrote it as a constant variable instead of a function
that imperatively fills a map. It's shorter, faster the compile,
and (depending on how badly the compiler screws it up) maybe
faster to run.

And, of course, it starts breaking up that giant .cpp file.


[ROCm/clr commit: 803d3ffd9c]
2017-10-24 20:38:25 +01:00