From d46969a7f21df01158318a404432c03d6d20968a Mon Sep 17 00:00:00 2001 From: "Cetnerowski, Adam" Date: Mon, 19 Nov 2018 16:29:16 +0100 Subject: [PATCH] Rename offline compiler: cloc -> ocloc Change-Id: I0595bac4c7266e77bd2ee17588694233547c8315 --- CMakeLists.txt | 2 +- offline_compiler/CMakeLists.txt | 22 ++++---- offline_compiler/offline_compiler.cpp | 2 +- offline_compiler/utilities/CMakeLists.txt | 2 +- runtime/built_ins/kernels/CMakeLists.txt | 10 ++-- runtime/scheduler/scheduler_binary.cmake | 8 +-- ubsan.supp | 2 +- unit_tests/CMakeLists.txt | 14 ++--- unit_tests/offline_compiler/CMakeLists.txt | 40 +++++++------- .../decoder/decoder_tests.cpp | 4 +- .../decoder/encoder_tests.cpp | 6 +-- .../offline_compiler_tests.cpp | 52 +++++++++---------- .../segfault_test/CMakeLists.txt | 34 ++++++------ 13 files changed, 99 insertions(+), 99 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04828b2285..b39a02de27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -613,7 +613,7 @@ else() endif(MSVC) add_subdirectory(offline_compiler ${IGDRCL_BUILD_DIR}/offline_compiler) -target_compile_definitions(cloc PRIVATE MOCKABLE_VIRTUAL=) +target_compile_definitions(ocloc PRIVATE MOCKABLE_VIRTUAL=) macro(generate_runtime_lib LIB_NAME MOCKABLE GENERATE_EXEC) set(NEO_STATIC_LIB_NAME ${LIB_NAME}) diff --git a/offline_compiler/CMakeLists.txt b/offline_compiler/CMakeLists.txt index 5e93c88747..9c23415074 100644 --- a/offline_compiler/CMakeLists.txt +++ b/offline_compiler/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -project(cloc) +project(ocloc) set(CLOC_SRCS_LIB ${IGDRCL_SOURCE_DIR}/offline_compiler/decoder/binary_decoder.cpp @@ -69,10 +69,10 @@ set(CLOC_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ) -add_executable(cloc ${CLOC_SRCS}) +add_executable(ocloc ${CLOC_SRCS}) add_subdirectories() -create_project_source_tree(cloc ${IGDRCL_SOURCE_DIR}/runtime) +create_project_source_tree(ocloc ${IGDRCL_SOURCE_DIR}/runtime) set(CLOC_INCLUDES ${IGC_OCL_ADAPTOR_DIR} @@ -85,22 +85,22 @@ set(CLOC_INCLUDES ${THIRD_PARTY_DIR} ) -target_include_directories(cloc BEFORE PRIVATE ${CLOC_INCLUDES}) +target_include_directories(ocloc BEFORE PRIVATE ${CLOC_INCLUDES}) -target_compile_definitions(cloc PUBLIC ${CLOC_LIB_FLAGS_DEFINITIONS} ${SUPPORTED_GEN_FLAGS_DEFINITONS} DEFAULT_PLATFORM=${DEFAULT_SUPPORTED_PLATFORM}) +target_compile_definitions(ocloc PUBLIC ${CLOC_LIB_FLAGS_DEFINITIONS} ${SUPPORTED_GEN_FLAGS_DEFINITONS} DEFAULT_PLATFORM=${DEFAULT_SUPPORTED_PLATFORM}) if(MSVC) - target_link_libraries(cloc dbghelp) + target_link_libraries(ocloc dbghelp) endif() if(UNIX) - target_link_libraries(cloc dl pthread) + target_link_libraries(ocloc dl pthread) endif() -target_link_libraries(cloc elflib) +target_link_libraries(ocloc elflib) -set_target_properties(cloc PROPERTIES FOLDER "offline_compiler") -set_property(TARGET cloc APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS} ${TSAN_FLAGS}) +set_target_properties(ocloc PROPERTIES FOLDER "offline_compiler") +set_property(TARGET ocloc APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS} ${TSAN_FLAGS}) add_custom_target(copy_compiler_files DEPENDS ${IGDRCL__IGC_TARGETS}) set_target_properties(copy_compiler_files PROPERTIES FOLDER "opencl runtime") @@ -109,7 +109,7 @@ foreach(TARGET_tmp ${IGDRCL__IGC_TARGETS}) add_custom_command( TARGET copy_compiler_files PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ + COMMAND ${CMAKE_COMMAND} -E copy_if_different $ $ ) endforeach() diff --git a/offline_compiler/offline_compiler.cpp b/offline_compiler/offline_compiler.cpp index 79431fbd5a..730e2aaf4a 100644 --- a/offline_compiler/offline_compiler.cpp +++ b/offline_compiler/offline_compiler.cpp @@ -620,7 +620,7 @@ std::string getDevicesTypes() { void OfflineCompiler::printUsage() { printf("Compiles CL files into llvm (.bc or .ll), gen isa (.gen), and binary files (.bin)\n\n"); - printf("cloc -file -device [OPTIONS]\n\n"); + printf("ocloc -file -device [OPTIONS]\n\n"); printf(" -file Indicates the CL kernel file to be compiled.\n"); printf(" -device Indicates which device for which we will compile.\n"); printf(" can be: %s\n", getDevicesTypes().c_str()); diff --git a/offline_compiler/utilities/CMakeLists.txt b/offline_compiler/utilities/CMakeLists.txt index b18d62486f..f107a7dd11 100644 --- a/offline_compiler/utilities/CMakeLists.txt +++ b/offline_compiler/utilities/CMakeLists.txt @@ -22,4 +22,4 @@ else() ) endif() -target_sources(cloc PRIVATE ${CLOC_SRCS_UTILITIES}) +target_sources(ocloc PRIVATE ${CLOC_SRCS_UTILITIES}) diff --git a/runtime/built_ins/kernels/CMakeLists.txt b/runtime/built_ins/kernels/CMakeLists.txt index 31f03e4648..d995fe66d0 100644 --- a/runtime/built_ins/kernels/CMakeLists.txt +++ b/runtime/built_ins/kernels/CMakeLists.txt @@ -22,7 +22,7 @@ endif() set(BUILTINS_INCLUDE_DIR ${TargetDir} PARENT_SCOPE) set(BUILTIN_CPP "") -# Define function for compiling built-ins (with cloc) +# Define function for compiling built-ins (with ocloc) function(compile_builtin gen_type platform_type builtin) string(TOLOWER ${gen_type} gen_type_lower) get_family_name_with_type(${gen_type} ${platform_type}) @@ -51,12 +51,12 @@ function(compile_builtin gen_type platform_type builtin) # set variable outside function set(BUILTIN_CPP built_ins/${NEO_ARCH}/${gen_type_lower}/${BASENAME}_${family_name_with_type}.cpp PARENT_SCOPE) if(WIN32) - set(cloc_cmd_prefix cloc) + set(cloc_cmd_prefix ocloc) else() if(DEFINED IGDRCL__IGC_LIBRARY_PATH) - set(cloc_cmd_prefix LD_LIBRARY_PATH=${IGDRCL__IGC_LIBRARY_PATH} $) + set(cloc_cmd_prefix LD_LIBRARY_PATH=${IGDRCL__IGC_LIBRARY_PATH} $) else() - set(cloc_cmd_prefix LD_LIBRARY_PATH=$ $) + set(cloc_cmd_prefix LD_LIBRARY_PATH=$ $) endif() endif() list(APPEND __cloc__options__ "-cl-kernel-arg-info") @@ -64,7 +64,7 @@ function(compile_builtin gen_type platform_type builtin) OUTPUT ${OUTPUT_FILES} COMMAND ${cloc_cmd_prefix} -q -file ${FILENAME} -device ${DEFAULT_SUPPORTED_${gen_type}_${platform_type}_PLATFORM} ${BUILTIN_OPTIONS} -${NEO_BITS} -out_dir ${OUTPUTDIR} -cpp_file -options "$" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${builtin} cloc copy_compiler_files + DEPENDS ${builtin} ocloc copy_compiler_files ) endfunction() diff --git a/runtime/scheduler/scheduler_binary.cmake b/runtime/scheduler/scheduler_binary.cmake index ffbc7d2ed3..eba6e83c06 100644 --- a/runtime/scheduler/scheduler_binary.cmake +++ b/runtime/scheduler/scheduler_binary.cmake @@ -32,12 +32,12 @@ function(compile_kernel target gen_type platform_type kernel) set(SCHEDULER_CPP "${OUTPUTDIR}/${BASENAME}_${family_name_with_type}.cpp") if(WIN32) - set(cloc_cmd_prefix cloc) + set(cloc_cmd_prefix ocloc) else() if(DEFINED IGDRCL__IGC_LIBRARY_PATH) - set(cloc_cmd_prefix LD_LIBRARY_PATH=${IGDRCL__IGC_LIBRARY_PATH} $) + set(cloc_cmd_prefix LD_LIBRARY_PATH=${IGDRCL__IGC_LIBRARY_PATH} $) else() - set(cloc_cmd_prefix LD_LIBRARY_PATH=$ $) + set(cloc_cmd_prefix LD_LIBRARY_PATH=$ $) endif() endif() list(APPEND __cloc__options__ "-cl-kernel-arg-info") @@ -46,7 +46,7 @@ function(compile_kernel target gen_type platform_type kernel) OUTPUT ${OUTPUTPATH} COMMAND ${cloc_cmd_prefix} -q -file ${kernel} -device ${DEFAULT_SUPPORTED_${gen_type}_${platform_type}_PLATFORM} -cl-intel-greater-than-4GB-buffer-required -${NEO_BITS} -out_dir ${OUTPUTDIR} -cpp_file -options "$" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS ${kernel} cloc copy_compiler_files + DEPENDS ${kernel} ocloc copy_compiler_files ) set(SCHEDULER_CPP ${SCHEDULER_CPP} PARENT_SCOPE) diff --git a/ubsan.supp b/ubsan.supp index 888e229b7e..2b56886baa 100644 --- a/ubsan.supp +++ b/ubsan.supp @@ -1,2 +1,2 @@ vptr:std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() -vptr:cloc +vptr:ocloc diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index 654a905818..fb1aa8448c 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -162,13 +162,13 @@ set_target_properties(run_unit_tests PROPERTIES FOLDER ${TEST_PROJECTS_FOLDER}) target_include_directories(igdrcl_tests BEFORE PRIVATE ${IGDRCL_SOURCE_DIR}/unit_tests/gen_common${BRANCH_DIR_SUFFIX}) if(WIN32) - set(cloc_cmd_prefix cloc) + set(cloc_cmd_prefix ocloc) set(ir_extension ".spv") else() if(DEFINED IGDRCL__IGC_LIBRARY_PATH) - set(cloc_cmd_prefix LD_LIBRARY_PATH=${IGDRCL__IGC_LIBRARY_PATH} $) + set(cloc_cmd_prefix LD_LIBRARY_PATH=${IGDRCL__IGC_LIBRARY_PATH} $) else() - set(cloc_cmd_prefix LD_LIBRARY_PATH=$ $) + set(cloc_cmd_prefix LD_LIBRARY_PATH=$ $) endif() set(ir_extension ".bc") endif() @@ -193,7 +193,7 @@ function(neo_gen_kernels target platform_name suffix) OUTPUT ${output_files} COMMAND ${cloc_cmd_prefix} -q -file ${filename} -device ${platform_name} -${NEO_BITS} -out_dir ${outputdir} WORKING_DIRECTORY ${workdir} - DEPENDS ${filepath} cloc + DEPENDS ${filepath} ocloc ) list(APPEND results ${output_files}) @@ -226,7 +226,7 @@ function(neo_gen_kernels_with_options target platform_name suffix filepath) OUTPUT ${output_files} COMMAND ${cloc_cmd_prefix} -q -file ${filename} -device ${platform_name} -${NEO_BITS} -out_dir ${outputdir} -options ${arg} -options_name WORKING_DIRECTORY ${workdir} - DEPENDS ${filearg} cloc + DEPENDS ${filearg} ocloc ) list(APPEND results ${output_files}) @@ -263,7 +263,7 @@ function(neo_gen_kernel_with_kernel_debug_options target platform_name suffix fi OUTPUT ${output_files} COMMAND ${cloc_cmd_prefix} -q -file ${filename} -device ${platform_name} -${NEO_BITS} -out_dir ${outputdir} -output ${argwospaces} -internal_options ${TEST_KERNEL_kernel_debug_enable} -options "-g" WORKING_DIRECTORY ${workdir} - DEPENDS ${filepath} cloc + DEPENDS ${filepath} ocloc ) list(APPEND results ${output_files}) @@ -290,7 +290,7 @@ function(neo_gen_kernel_from_ll target platform_name suffix filepath output_name OUTPUT ${output_files} COMMAND ${cloc_cmd_prefix} -q -file ${filename} -output ${output_name} -device ${platform_name} -${NEO_BITS} -out_dir ${outputdir} -internal_options ${compile_options} -llvm_input WORKING_DIRECTORY ${workdir} - DEPENDS ${filepath} cloc + DEPENDS ${filepath} ocloc ) list(APPEND results ${output_files}) diff --git a/unit_tests/offline_compiler/CMakeLists.txt b/unit_tests/offline_compiler/CMakeLists.txt index 74b2399a65..3bea07828b 100644 --- a/unit_tests/offline_compiler/CMakeLists.txt +++ b/unit_tests/offline_compiler/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -project(cloc_tests) +project(ocloc_tests) set(IGDRCL_SRCS_cloc ${IGDRCL_SOURCE_DIR}/offline_compiler/decoder/binary_decoder.cpp @@ -48,38 +48,38 @@ endif() link_directories(${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) -add_executable(cloc_tests ${IGDRCL_SRCS_offline_compiler_tests}) +add_executable(ocloc_tests ${IGDRCL_SRCS_offline_compiler_tests}) -target_include_directories(cloc_tests PRIVATE - $ +target_include_directories(ocloc_tests PRIVATE + $ ) -target_compile_definitions(cloc_tests PUBLIC MOCKABLE_VIRTUAL=virtual $) +target_compile_definitions(ocloc_tests PUBLIC MOCKABLE_VIRTUAL=virtual $) -target_link_libraries(cloc_tests igdrcl_mocks gmock-gtest elflib) +target_link_libraries(ocloc_tests igdrcl_mocks gmock-gtest elflib) if(UNIX) - target_link_libraries(cloc_tests dl pthread) + target_link_libraries(ocloc_tests dl pthread) endif() -get_property(CLOC_FOLDER TARGET cloc PROPERTY FOLDER) -get_property(CLOC_COMPILE_FLAGS TARGET cloc PROPERTY COMPILE_FLAGS) -set_property(TARGET cloc_tests PROPERTY FOLDER ${CLOC_FOLDER}) -set_property(TARGET cloc_tests APPEND_STRING PROPERTY COMPILE_FLAGS ${CLOC_COMPILE_FLAGS}) +get_property(CLOC_FOLDER TARGET ocloc PROPERTY FOLDER) +get_property(CLOC_COMPILE_FLAGS TARGET ocloc PROPERTY COMPILE_FLAGS) +set_property(TARGET ocloc_tests PROPERTY FOLDER ${CLOC_FOLDER}) +set_property(TARGET ocloc_tests APPEND_STRING PROPERTY COMPILE_FLAGS ${CLOC_COMPILE_FLAGS}) string(TOLOWER ${DEFAULT_TESTED_PLATFORM} CLOC_DEFAULT_DEVICE) -add_custom_target(run_cloc_tests ALL - DEPENDS cloc_tests +add_custom_target(run_ocloc_tests ALL + DEPENDS ocloc_tests ) macro(macro_for_each_platform) if("${PLATFORM_IT_LOWER}" STREQUAL "${CLOC_DEFAULT_DEVICE}") foreach(PLATFORM_TYPE "CORE" "LP") if(${PLATFORM_IT}_IS_${PLATFORM_TYPE}) get_family_name_with_type(${GEN_TYPE} ${PLATFORM_TYPE}) - add_dependencies(run_cloc_tests test_kernels_${family_name_with_type}) + add_dependencies(run_ocloc_tests test_kernels_${family_name_with_type}) neo_copy_test_files(copy_test_files_${family_name_with_type} ${family_name_with_type}) - add_dependencies(run_cloc_tests copy_test_files_${family_name_with_type}) - set(run_tests_cmd cloc_tests --device ${CLOC_DEFAULT_DEVICE} --family_type ${family_name_with_type}) + add_dependencies(run_ocloc_tests copy_test_files_${family_name_with_type}) + set(run_tests_cmd ocloc_tests --device ${CLOC_DEFAULT_DEVICE} --family_type ${family_name_with_type}) endif() endforeach() endif() @@ -89,11 +89,11 @@ macro(macro_for_each_gen) endmacro() apply_macro_for_each_gen("TESTED") -set_property(TARGET run_cloc_tests PROPERTY FOLDER ${CLOC_FOLDER}) +set_property(TARGET run_ocloc_tests PROPERTY FOLDER ${CLOC_FOLDER}) if(WIN32) add_custom_command( - TARGET run_cloc_tests + TARGET run_ocloc_tests POST_BUILD COMMAND echo deleting offline compiler files and directories... COMMAND ${CMAKE_COMMAND} -E remove ${TargetDir}/${CLOC_DEFAULT_DEVICE}/copybuffer_${CLOC_DEFAULT_DEVICE}.bc @@ -105,7 +105,7 @@ if(WIN32) ) else() add_custom_command( - TARGET run_cloc_tests + TARGET run_ocloc_tests POST_BUILD COMMAND echo deleting offline compiler files and directories... COMMAND ${CMAKE_COMMAND} -E remove ${TargetDir}/${CLOC_DEFAULT_DEVICE}/*.bc @@ -119,4 +119,4 @@ else() endif() add_subdirectories() -create_project_source_tree(cloc_tests ${IGDRCL_SOURCE_DIR}/runtime ${IGDRCL_SOURCE_DIR}/unit_tests ${IGDRCL_SOURCE_DIR}) +create_project_source_tree(ocloc_tests ${IGDRCL_SOURCE_DIR}/runtime ${IGDRCL_SOURCE_DIR}/unit_tests ${IGDRCL_SOURCE_DIR}) diff --git a/unit_tests/offline_compiler/decoder/decoder_tests.cpp b/unit_tests/offline_compiler/decoder/decoder_tests.cpp index ff67416ba6..62e3a55e9a 100644 --- a/unit_tests/offline_compiler/decoder/decoder_tests.cpp +++ b/unit_tests/offline_compiler/decoder/decoder_tests.cpp @@ -29,7 +29,7 @@ SKernelBinaryHeaderCommon createKernelBinaryHeaderCommon(const uint32_t kernelNa namespace OCLRT { TEST(DecoderTests, WhenParsingValidListOfParametersThenReturnValueIsZero) { const char *argv[] = { - "cloc", + "ocloc", "decoder", "-file", "test_files/binary.bin", @@ -44,7 +44,7 @@ TEST(DecoderTests, WhenParsingValidListOfParametersThenReturnValueIsZero) { TEST(DecoderTests, WhenMissingParametersThenValidateInputReturnsErrorCode) { const char *argv[] = { - "cloc", + "ocloc", "decoder", "-file", "test_files/binary.bin", diff --git a/unit_tests/offline_compiler/decoder/encoder_tests.cpp b/unit_tests/offline_compiler/decoder/encoder_tests.cpp index 4767ba32a3..78845dd039 100644 --- a/unit_tests/offline_compiler/decoder/encoder_tests.cpp +++ b/unit_tests/offline_compiler/decoder/encoder_tests.cpp @@ -17,7 +17,7 @@ namespace OCLRT { TEST(EncoderTests, WhenParsingValidListOfParametersThenReturnValueIsZero) { const char *argv[] = { - "cloc", + "ocloc", "asm", "-dump", "test_files/dump", @@ -30,7 +30,7 @@ TEST(EncoderTests, WhenParsingValidListOfParametersThenReturnValueIsZero) { TEST(EncoderTests, WhenMissingParametersThenErrorCodeIsReturned) { const char *argv[] = { - "cloc", + "ocloc", "asm", "-dump", "test_files/dump", @@ -42,7 +42,7 @@ TEST(EncoderTests, WhenMissingParametersThenErrorCodeIsReturned) { TEST(EncoderTests, GivenWrongParametersWhenParsingParametersThenErrorCodeIsReturne) { const char *argv[] = { - "cloc", + "ocloc", "asm", "-dump", "", diff --git a/unit_tests/offline_compiler/offline_compiler_tests.cpp b/unit_tests/offline_compiler/offline_compiler_tests.cpp index 9f03531be7..a4d5db6fcc 100644 --- a/unit_tests/offline_compiler/offline_compiler_tests.cpp +++ b/unit_tests/offline_compiler/offline_compiler_tests.cpp @@ -41,7 +41,7 @@ void compilerOutputRemove(const std::string &fileName, const std::string &type) TEST_F(OfflineCompilerTests, GoodArgTest) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -57,7 +57,7 @@ TEST_F(OfflineCompilerTests, GoodArgTest) { TEST_F(OfflineCompilerTests, TestExtensions) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -72,7 +72,7 @@ TEST_F(OfflineCompilerTests, TestExtensions) { TEST_F(OfflineCompilerTests, GoodBuildTest) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -99,7 +99,7 @@ TEST_F(OfflineCompilerTests, GoodBuildTest) { TEST_F(OfflineCompilerTests, GoodBuildTestWithLlvmText) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -122,7 +122,7 @@ TEST_F(OfflineCompilerTests, GoodBuildTestWithLlvmText) { TEST_F(OfflineCompilerTests, GoodParseBinToCharArray) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -169,7 +169,7 @@ TEST_F(OfflineCompilerTests, GoodParseBinToCharArray) { TEST_F(OfflineCompilerTests, GoodBuildTestWithCppFile) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -193,7 +193,7 @@ TEST_F(OfflineCompilerTests, GoodBuildTestWithCppFile) { TEST_F(OfflineCompilerTests, GoodBuildTestWithOutputDir) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -217,7 +217,7 @@ TEST_F(OfflineCompilerTests, GoodBuildTestWithOutputDir) { TEST_F(OfflineCompilerTests, PrintUsage) { auto argv = { - "cloc", + "ocloc", "-?"}; testing::internal::CaptureStdout(); @@ -233,7 +233,7 @@ TEST_F(OfflineCompilerTests, PrintUsage) { TEST_F(OfflineCompilerTests, NaughtyArgTest_File) { DebugManager.flags.PrintDebugMessages.set(true); auto argv = { - "cloc", + "ocloc", "-file", "test_files/ImANaughtyFile.cl", "-device", @@ -251,7 +251,7 @@ TEST_F(OfflineCompilerTests, NaughtyArgTest_File) { TEST_F(OfflineCompilerTests, NaughtyArgTest_Flag) { auto argv = { - "cloc", + "ocloc", "-n", "test_files/ImANaughtyFile.cl", "-device", @@ -269,7 +269,7 @@ TEST_F(OfflineCompilerTests, NaughtyArgTest_Flag) { TEST_F(OfflineCompilerTests, NaughtyArgTest_NumArgs) { auto argvA = { - "cloc", + "ocloc", "-file", }; @@ -284,7 +284,7 @@ TEST_F(OfflineCompilerTests, NaughtyArgTest_NumArgs) { delete pOfflineCompiler; auto argvB = { - "cloc", + "ocloc", "-file", "test_files/ImANaughtyFile.cl", "-device"}; @@ -300,7 +300,7 @@ TEST_F(OfflineCompilerTests, NaughtyArgTest_NumArgs) { TEST_F(OfflineCompilerTests, GivenNonexistantDeviceWhenCompilingThenExitWithErrorMsg) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -316,7 +316,7 @@ TEST_F(OfflineCompilerTests, GivenNonexistantDeviceWhenCompilingThenExitWithErro TEST_F(OfflineCompilerTests, NaughtyKernelTest) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/shouldfail.cl", "-device", @@ -346,7 +346,7 @@ TEST_F(OfflineCompilerTests, NaughtyKernelTest) { TEST(OfflineCompilerTest, parseCmdLine) { auto argv = { - "cloc", + "ocloc", "-cl-intel-greater-than-4GB-buffer-required"}; MockOfflineCompiler *mockOfflineCompiler = new MockOfflineCompiler(); @@ -466,7 +466,7 @@ TEST(OfflineCompilerTest, buildSourceCode) { EXPECT_EQ(CL_INVALID_PROGRAM, retVal); auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-device", @@ -493,7 +493,7 @@ TEST(OfflineCompilerTest, GivenKernelWhenNoCharAfterKernelSourceThenBuildWithSuc EXPECT_EQ(CL_INVALID_PROGRAM, retVal); auto argv = { - "cloc", + "ocloc", "-file", "test_files/emptykernel.cl", "-device", @@ -538,7 +538,7 @@ TEST(OfflineCompilerTest, generateElfBinary) { TEST(OfflineCompilerTest, givenLlvmInputOptionPassedWhenCmdLineParsedThenInputFileLlvmIsSetTrue) { auto argv = { - "cloc", + "ocloc", "-llvm_input"}; auto mockOfflineCompiler = std::unique_ptr(new MockOfflineCompiler()); @@ -563,7 +563,7 @@ TEST(OfflineCompilerTest, givenDefaultOfflineCompilerObjectWhenNoOptionsAreChang } TEST(OfflineCompilerTest, givenSpirvInputOptionPassedWhenCmdLineParsedThenInputFileSpirvIsSetTrue) { - auto argv = {"cloc", "-spirv_input"}; + auto argv = {"ocloc", "-spirv_input"}; auto mockOfflineCompiler = std::unique_ptr(new MockOfflineCompiler()); @@ -583,7 +583,7 @@ TEST(OfflineCompilerTest, givenDefaultOfflineCompilerObjectWhenNoOptionsAreChang TEST(OfflineCompilerTest, givenIntermediatedRepresentationInputWhenBuildSourceCodeIsCalledThenProperTranslationContextIsUed) { MockOfflineCompiler mockOfflineCompiler; auto argv = { - "cloc", + "ocloc", "-file", "test_files/emptykernel.cl", "-device", @@ -612,13 +612,13 @@ TEST(OfflineCompilerTest, givenIntermediatedRepresentationInputWhenBuildSourceCo } TEST(OfflineCompilerTest, givenBinaryInputThenDontTruncateSourceAtFirstZero) { - auto argvLlvm = {"cloc", "-llvm_input", "-file", "test_files/binary_with_zeroes", + auto argvLlvm = {"ocloc", "-llvm_input", "-file", "test_files/binary_with_zeroes", "-device", gEnvironment->devicePrefix.c_str()}; auto mockOfflineCompiler = std::make_unique(); mockOfflineCompiler->initialize(argvLlvm.size(), argvLlvm.begin()); EXPECT_LT(0U, mockOfflineCompiler->sourceCode.size()); - auto argvSpirV = {"cloc", "-spirv_input", "-file", "test_files/binary_with_zeroes", + auto argvSpirV = {"ocloc", "-spirv_input", "-file", "test_files/binary_with_zeroes", "-device", gEnvironment->devicePrefix.c_str()}; mockOfflineCompiler = std::make_unique(); mockOfflineCompiler->initialize(argvSpirV.size(), argvSpirV.begin()); @@ -627,7 +627,7 @@ TEST(OfflineCompilerTest, givenBinaryInputThenDontTruncateSourceAtFirstZero) { TEST(OfflineCompilerTest, givenOutputFileOptionWhenSourceIsCompiledThenOutputFileHasCorrectName) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-output", @@ -660,7 +660,7 @@ TEST(OfflineCompilerTest, givenOutputFileOptionWhenSourceIsCompiledThenOutputFil TEST(OfflineCompilerTest, givenDebugDataAvailableWhenSourceIsBuiltThenDebugDataFileIsCreated) { auto argv = { - "cloc", + "ocloc", "-file", "test_files/copybuffer.cl", "-output", @@ -705,7 +705,7 @@ TEST(OfflineCompilerTest, givenDebugDataAvailableWhenSourceIsBuiltThenDebugDataF TEST(OfflineCompilerTest, givenInternalOptionsWhenCmdLineParsedThenOptionsAreAppendedToInternalOptionsString) { auto argv = { - "cloc", + "ocloc", "-internal_options", "myInternalOptions"}; @@ -730,7 +730,7 @@ TEST(OfflineCompilerTest, givenInputOtpionsAndInternalOptionsFilesWhenOfflineCom ASSERT_TRUE(fileExists("test_files/shouldfail_internal_options.txt")); auto argv = { - "cloc", + "ocloc", "-q", "-file", "test_files/shouldfail.cl", diff --git a/unit_tests/offline_compiler/segfault_test/CMakeLists.txt b/unit_tests/offline_compiler/segfault_test/CMakeLists.txt index 825bb00847..471f3279e5 100644 --- a/unit_tests/offline_compiler/segfault_test/CMakeLists.txt +++ b/unit_tests/offline_compiler/segfault_test/CMakeLists.txt @@ -28,15 +28,15 @@ else() ) endif() -add_executable(cloc_segfault_test ${CLOC_SEGFAULT_TEST_SOURCES}) -target_link_libraries(cloc_segfault_test gmock-gtest) +add_executable(ocloc_segfault_test ${CLOC_SEGFAULT_TEST_SOURCES}) +target_link_libraries(ocloc_segfault_test gmock-gtest) if(MSVC) - target_compile_options(cloc_segfault_test PRIVATE /Zi) - set_property(TARGET cloc_segfault_test APPEND PROPERTY LINK_FLAGS /DEBUG) - target_link_libraries(cloc_segfault_test dbghelp) + target_compile_options(ocloc_segfault_test PRIVATE /Zi) + set_property(TARGET ocloc_segfault_test APPEND PROPERTY LINK_FLAGS /DEBUG) + target_link_libraries(ocloc_segfault_test dbghelp) endif() if(UNIX) - target_link_libraries(cloc_segfault_test dl pthread) + target_link_libraries(ocloc_segfault_test dl pthread) endif() set(CLOC_SEGFAULT_TEST_INCLUDES @@ -45,25 +45,25 @@ set(CLOC_SEGFAULT_TEST_INCLUDES ) if(CMAKE_COMPILER_IS_GNUCC) - target_compile_definitions(cloc_segfault_test PRIVATE SKIP_SEGFAULT_TEST=1) + target_compile_definitions(ocloc_segfault_test PRIVATE SKIP_SEGFAULT_TEST=1) endif() -get_property(CLOC_FOLDER TARGET cloc PROPERTY FOLDER) -set_property(TARGET cloc_segfault_test PROPERTY FOLDER ${CLOC_FOLDER}) +get_property(CLOC_FOLDER TARGET ocloc PROPERTY FOLDER) +set_property(TARGET ocloc_segfault_test PROPERTY FOLDER ${CLOC_FOLDER}) -target_include_directories(cloc_segfault_test BEFORE PRIVATE ${CLOC_SEGFAULT_TEST_INCLUDES}) -create_project_source_tree(cloc_segfault_test ${IGDRCL_SOURCE_DIR}/offline_compiler ${IGDRCL_SOURCE_DIR}/runtime ${IGDRCL_SOURCE_DIR}/unit_tests) +target_include_directories(ocloc_segfault_test BEFORE PRIVATE ${CLOC_SEGFAULT_TEST_INCLUDES}) +create_project_source_tree(ocloc_segfault_test ${IGDRCL_SOURCE_DIR}/offline_compiler ${IGDRCL_SOURCE_DIR}/runtime ${IGDRCL_SOURCE_DIR}/unit_tests) -add_custom_target(run_cloc_segfault_test ALL - DEPENDS cloc_segfault_test +add_custom_target(run_ocloc_segfault_test ALL + DEPENDS ocloc_segfault_test ) add_custom_command( - TARGET run_cloc_segfault_test + TARGET run_ocloc_segfault_test POST_BUILD - COMMAND echo Running cloc_segfault_test - COMMAND cloc_segfault_test + COMMAND echo Running ocloc_segfault_test + COMMAND ocloc_segfault_test WORKING_DIRECTORY ${TargetDir} ) -set_property(TARGET run_cloc_segfault_test PROPERTY FOLDER ${CLOC_FOLDER}) +set_property(TARGET run_ocloc_segfault_test PROPERTY FOLDER ${CLOC_FOLDER})