Commit Graph

19 Commits

Author SHA1 Message Date
Evgeny Mankov bdb114188c clang-hipify: code refactoring - API (Driver/Runtime/Blas) distinguishing is added.
[ROCm/clr commit: 5cca5b3dca]
2016-08-25 19:36:37 +03:00
Evgeny Mankov 9768864f17 clang-hipify: code refactoring and performance improvement
[ROCm/clr commit: 207eb02736]
2016-08-24 18:51:36 +03:00
Evgeny Mankov 45bd4c79d7 clang-hipify: After translating any symbol forcibly include the hip header file in case it wasn’t.
Fixes https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/34


[ROCm/clr commit: 00b9782187]
2016-08-18 20:59:51 +03:00
Evgeny Mankov dad90dcfa1 clang-hipify: Add support for nested macro expansion and translation.
Fixes bug “HIPIFY: nested macro is not hipified”
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/33

Example:
#include "cuda_runtime.h"
#define MY_MACRO(func, flags) (func, flags)
...
cudaEvent_t *event = NULL;
MY_MACRO(cudaEventCreateWithFlags(event, cudaEventDisableTiming), NULL);

where cudaEventDisableTiming is a defined numeric literal and thus a nested MACRO:
#define cudaEventDisableTiming 0x02 /**< Event will not record timing data */

After hipifying now:
MY_MACRO(hipEventCreateWithFlags(event, cudaEventDisableTiming), NULL);

Should be:
MY_MACRO(hipEventCreateWithFlags(event, hipEventDisableTiming), NULL);


[ROCm/clr commit: aba73d6673]
2016-08-11 22:29:55 +03:00
Evgeny Mankov 67629d0c65 clang-hipify: Transformation of declarations with external linkage and shared attribute for IncompleteArrayType (aka C array[]) only.
Example:
extern __shared__ uint sRadix1[]; =>  HIP_DYNAMIC_SHARED(unsigned int, sRadix1);


[ROCm/clr commit: b7ac63e202]
2016-08-05 21:35:58 +03:00
Maneesh Gupta cc9a901498 Documentation updates
Change-Id: Ia624d86915c4c96da0ac0242f767135f30ff73c6


[ROCm/clr commit: b29ed98f9a]
2016-07-25 14:53:15 +05:30
Evgeny Mankov 11b143ae2d clang-hipify: Populate replacement rules and fix typos.
+ fix typo in hipStreamWaitEvent.
+ hipHostAlloc -> hipHostMalloc.
+ Memory Types, Pointer Attributes are added.
+ Event, Host Malloc and Register, Device and Stream Flags are added.
+ exclude cudacommon.h.prehip from includes' replacement rules.


[ROCm/clr commit: 9f77666802]
2016-07-07 18:01:41 +03:00
Evgeny Mankov 7d19c11a56 clang-hipify: add Replacement Excludes
Excludes are not replaced, for instance, CHECK_CUDA_ERROR and CUDA_SAFE_CALL.
Add check for excludes in MacroExpands and CallExpr routines.


[ROCm/clr commit: 5d04a17a44]
2016-07-01 19:58:14 +03:00
Evgeny Mankov 80026f4019 clang-hipify: fix typos and populate replacement rules
+ typos in cudaDeviceAttr and cudaDeviceAttr
+ Device Attribules are added
+ More error codes are added


[ROCm/clr commit: 53401727a8]
2016-06-29 20:32:05 +03:00
Evgeny Mankov ee53c355d1 clang-hipify: Array of elements of typedef type translation support.
Example: cudaStream_t streams[2]


[ROCm/clr commit: f19992760e]
2016-06-28 19:57:08 +03:00
Evgeny Mankov 96dd64f05b cublas to hipblas translation support in clang-hipify
+ CUBLAS V2 functions support
+ annotating, formatting


[ROCm/clr commit: ab2a7f436d]
2016-06-28 15:33:38 +03:00
Evgeny Mankov 48a624cb4c Initial cublas to hipblas translation support in clang-hipify.
To run clang-hipify with hipblas support please specify corresponding hipblas include directory, for example:

./hipify-clang --print-stats matrixMult.cpp.cuda -- -I/srv/git/HIP/HIP-Examples/hipblas/include

Additionally:
+ typedef translation support is added (cudaEvent_t and cudaStream_t are converted now).
+ anonymous typedef enum translation support.
+ function name macro expansion support.
+ clang options propagation is restored.
P.S. In order to avoid the following error message:
“Could not auto-detect compilation database for file "… .cu"
No compilation database found in /srv/git/HIP/build/clang-hipify or any parent directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.”
please append “--“ to the end of clang-hipify’s command line.


[ROCm/clr commit: aa75bff6ee]
2016-06-22 19:15:03 +03:00
Maneesh Gupta d01e9482ae Move hipify-clang info to its own README
Squashed commit of the following:

commit bc44bcee461e46b0cf5cb9fe09213dca450b081a
Author: Daniil Fukalov <daniil.fukalov@amd.com>
Date:   Mon May 16 20:50:05 2016 +0300

    added note about errors without CUDA sdk installed

commit 5fd73ba90c0940bdc977737894362a99f4232b56
Author: Daniil Fukalov <daniil.fukalov@amd.com>
Date:   Mon May 16 20:31:47 2016 +0300

    move clang-hipify info to its own README

commit 21d81a6d5acd3f093d77ac4d584e6f5bbe48f8cc
Author: Daniil Fukalov <daniil.fukalov@amd.com>
Date:   Mon May 16 20:30:00 2016 +0300

    initial version

Change-Id: I157294699a7be3d0bb38b2ee4a137a94280529c9


[ROCm/clr commit: be0d44bd74]
2016-05-24 12:45:25 +05:30
Maneesh Gupta 0644603c07 Fix missing JSON database warning from hipify-clang
Change-Id: I4aeff51556678266c1392a031deeb9ffff2386bc


[ROCm/clr commit: 4efabb955b]
2016-05-20 14:06:27 +05:30
Maneesh Gupta d33b8ebcb3 Handle missing LLVM package dependency for clang hipify
[ROCm/clr commit: c95c1903b3]
2016-05-04 14:47:26 +05:30
alex-t 51540789c7 Fixed incorrect kernel paramlist replacement length & hipGetDeviceProperties mapping
[ROCm/clr commit: fb19b58840]
2016-04-14 13:48:58 +03:00
Daniil Fukalov 8a45101aea Delete README.md
[ROCm/clr commit: 06dfaa4cf4]
2016-04-07 00:37:20 +03:00
dfukalov a04015e0f7 moved clang-hipify tests to common folder "tests", updated cmake files to use downloadable clang+llvm binary package
[ROCm/clr commit: f1e64fe2b4]
2016-04-06 20:44:19 +03:00
dfukalov b16f34446a Imported clang-hipify as a subtree
[ROCm/clr commit: 2a76cb6fc0]
2016-04-04 23:18:15 +03:00