From a08193953daaab28a7e7dab76152d419b51f6666 Mon Sep 17 00:00:00 2001 From: Andrew Gozillon Date: Tue, 16 Apr 2019 18:08:18 -0700 Subject: [PATCH] Prefix Kernel Names with "x" Seems a little arbitrary, but functions generally should start with a character. This was causing some problems with HW synthesis, this quick fix works around that for now, until we decide on a better way to name kernels. --- llvm/lib/SYCL/InSPIRation/InSPIRation.cpp | 2 +- sycl/source/detail/program_manager/program_manager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/SYCL/InSPIRation/InSPIRation.cpp b/llvm/lib/SYCL/InSPIRation/InSPIRation.cpp index 93e4a1a74994..3fe37a2ba8f4 100644 --- a/llvm/lib/SYCL/InSPIRation/InSPIRation.cpp +++ b/llvm/lib/SYCL/InSPIRation/InSPIRation.cpp @@ -244,7 +244,7 @@ struct InSPIRation : public ModulePass { /// changing all the names to a SHA-1 hash. Like asking for an update /// to the xocc compiler to accept characters that appear in mangled /// names - F.setName(std::to_string(uuidHashValue)); + F.setName("x" + std::to_string(uuidHashValue)); } /// Add metadata for the SPIR 2.0 version diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index c70e8f9d2114..8ab0beadddc1 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -116,7 +116,7 @@ static std::string getUniqueName(const char *KernelName) { boost::hash uuid_hasher; std::size_t uuid_hash_value = uuid_hasher(udoc); - return std::to_string(uuid_hash_value); + return "x" + std::to_string(uuid_hash_value); } cl_kernel ProgramManager::getOrCreateKernel(OSModuleHandle M,