diff options
author | Artem Belevich <tra@google.com> | 2021-07-19 19:55:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-19 21:55:23 -0500 |
commit | 115cbf381712d4eed05295e2be077ac13b83dc25 (patch) | |
tree | b4f7a0221db718e84a5a59722e02f0b243523787 /lib/compilers/clang.js | |
parent | f3acbc972a267b75647acb4c11e612b7e5d7aee8 (diff) | |
download | compiler-explorer-115cbf381712d4eed05295e2be077ac13b83dc25.tar.gz compiler-explorer-115cbf381712d4eed05295e2be077ac13b83dc25.zip |
Add support for HIP compilation for AMD GPUs. (#2759)
* Added support for HIP compilation for AMD GPUs.
At the moment it only supports stand-alone compilation w/o ROCm SDK.
* Enable barebones HIP compilation.
Clang by itself is good enough to compile simple kernels that do not need ROCm
SDK headers and bitcode libraries.
Closes #2760
Diffstat (limited to 'lib/compilers/clang.js')
-rw-r--r-- | lib/compilers/clang.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/compilers/clang.js b/lib/compilers/clang.js index fa197d026..5e3252965 100644 --- a/lib/compilers/clang.js +++ b/lib/compilers/clang.js @@ -24,6 +24,7 @@ import path from 'path'; +import { AmdgpuAsmParser } from '../asm-parser-amdgpu'; import { SassAsmParser } from '../asm-parser-sass'; import { BaseCompiler } from '../base-compiler'; @@ -68,3 +69,15 @@ export class ClangCudaCompiler extends ClangCompiler { return result; } } +export class ClangHipCompiler extends ClangCompiler { + static get key() { return 'clang-hip'; } + constructor(info, env) { + super(info, env); + + this.asm = new AmdgpuAsmParser(); + } + + optionsForFilter(filters, outputFilename) { + return ['-o', this.filename(outputFilename), '-g1', '--no-gpu-bundle-output', filters.binary ? '-c' : '-S']; + } +} |