diff --git a/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp b/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp index 2dafa13384..537eac66f4 100644 --- a/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp +++ b/rocclr/compiler/lib/backends/common/v0_8/if_acl.cpp @@ -154,11 +154,11 @@ LOADER_FUNCS_ERROR(AMDILOpt, amdcl::GPUOptimizer); #if defined(WITH_TARGET_HSAIL) LOADER_FUNCS(HSAILAsm, amdcl::HSAIL); -LOADER_FUNCS(HSAILFE, amdcl::OCLFrontend); +LOADER_FUNCS(HSAILFE, amdcl::ClangOCLFrontend); LOADER_FUNCS(HSAILOpt, amdcl::GPUOptimizer); #else LOADER_FUNCS_ERROR(HSAILAsm, amdcl::HSAIL); -LOADER_FUNCS_ERROR(HSAILFE, amdcl::OCLFrontend); +LOADER_FUNCS_ERROR(HSAILFE, amdcl::ClangOCLFrontend); LOADER_FUNCS_ERROR(HSAILOpt, amdcl::GPUOptimizer); #endif @@ -170,8 +170,11 @@ LOADER_FUNCS_ERROR(X86Asm, amdcl::X86); LOADER_FUNCS_ERROR(X86Opt, amdcl::CPUOptimizer); #endif +#if defined(LEGACY_COMPLIB) LOADER_FUNCS(OCL, amdcl::OCLFrontend); -LOADER_FUNCS(OCLClang, amdcl::ClangOCLFrontend); +#else +LOADER_FUNCS(OCL, amdcl::ClangOCLFrontend); +#endif LOADER_FUNCS(Link, amdcl::OCLLinker); LOADER_FUNCS(Codegen, amdcl::CLCodeGen); LOADER_FUNCS(SPIR, amdcl::SPIR); diff --git a/rocclr/compiler/lib/complibdefs b/rocclr/compiler/lib/complibdefs index 7f3c21a770..c0691f513f 100644 --- a/rocclr/compiler/lib/complibdefs +++ b/rocclr/compiler/lib/complibdefs @@ -6,6 +6,9 @@ ifeq ($(BUILD_HSA_TARGET),yes) override BUILD_CPU_DEVICE = no override BUILD_GPU_DEVICE = no endif +ifneq ($(BUILD_LEGACY_COMPLIB),yes) +override BUILD_GPU_DEVICE = no +endif endif ifneq ($(BUILD_GPU_DEVICE),no) @@ -84,4 +87,4 @@ endif ifeq ($(OPENCL_USE_ONE_SC),1) GCPPFLAGS += $(DEFSWITCH) OPENCL_USE_ONE_SC -endif \ No newline at end of file +endif diff --git a/rocclr/compiler/lib/utils/v0_8/libUtils.h b/rocclr/compiler/lib/utils/v0_8/libUtils.h index 9ab0243e83..faabe65f49 100644 --- a/rocclr/compiler/lib/utils/v0_8/libUtils.h +++ b/rocclr/compiler/lib/utils/v0_8/libUtils.h @@ -178,7 +178,7 @@ inline bool isHSAILTarget(const aclTargetInfo& target) enum scId { SC_AMDIL = 0, - SC_HSAIL = 1, + SC_HSAIL = 0, SC_LAST, }; diff --git a/rocclr/runtime/device/cpu/cpudevice.cpp b/rocclr/runtime/device/cpu/cpudevice.cpp index d871cff32e..6d1aa5afea 100644 --- a/rocclr/runtime/device/cpu/cpudevice.cpp +++ b/rocclr/runtime/device/cpu/cpudevice.cpp @@ -61,7 +61,8 @@ Device::init() const char *library = getenv("COMPILER_LIBRARY"); aclCompilerOptions opts = { sizeof(aclCompilerOptions_0_8), - library, + library ? library : LINUX_ONLY("lib") "amdocl12cl" \ + LP64_SWITCH(LINUX_SWITCH("32",""),"64") LINUX_SWITCH(".so",".dll"), NULL, NULL, NULL, @@ -71,7 +72,12 @@ Device::init() &::malloc, &::free }; - compiler_ = aclCompilerInit(NULL, NULL); + acl_error error; + compiler_ = aclCompilerInit(&opts, &error); + if (error != ACL_SUCCESS) { + LogError("Error initializing the compiler"); + return false; + } device::Info info; ::memset(&info, '\0', sizeof(info)); diff --git a/rocclr/runtime/device/gpu/gpudevice.cpp b/rocclr/runtime/device/gpu/gpudevice.cpp index c6a3bcffed..2b18e64548 100644 --- a/rocclr/runtime/device/gpu/gpudevice.cpp +++ b/rocclr/runtime/device/gpu/gpudevice.cpp @@ -1237,7 +1237,8 @@ Device::init() const char *library = getenv("COMPILER_LIBRARY"); aclCompilerOptions opts = { sizeof(aclCompilerOptions_0_8), - library, + library ? library : LINUX_ONLY("lib") "amdocl12cl" \ + LP64_SWITCH(LINUX_SWITCH("32",""),"64") LINUX_SWITCH(".so",".dll"), NULL, NULL, NULL,