### Component Installation Settings Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Configures component-based installation for DEB, RPM, and Archive packaging formats, allowing for granular control over installed files. ```cmake set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_RPM_COMPONENT_INSTALL ON) set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) ``` -------------------------------- ### Define Installable Components Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Specifies all components that can be installed, including core libraries, OpenCL support, and development files for both. ```cmake set(CPACK_COMPONENTS_ALL igc-core igc-opencl igc-opencl-devel igc-core-devel) ``` -------------------------------- ### Install IGC Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/build_ubuntu.md Install the compiled Intel Graphics Compiler to the system using the Make install target. ```shell sudo make install ``` -------------------------------- ### LIFETIME Usage Examples Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/LIFETIME.md Illustrates the syntax for marking the start and end of a variable's lifetime using the LIFETIME opcode. ```text LIFETIME.start LIFETIME.end ``` -------------------------------- ### Install IGA on UNIX Systems Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/iga/IGALibrary/CMakeLists.txt Installs the IGA DLL on UNIX-like systems. It determines the library path based on CMAKE_INSTALL_FULL_LIBDIR or CMAKE_INSTALL_PREFIX and installs the library for different components. ```cmake if(UNIX) if (CMAKE_INSTALL_FULL_LIBDIR) set(IGA_LIB_PATH ${CMAKE_INSTALL_FULL_LIBDIR}) else() set(IGA_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib) endif() INSTALL(TARGETS IGA_DLL LIBRARY DESTINATION ${IGA_LIB_PATH} COMPONENT igc-core NAMELINK_SKIP) INSTALL(TARGETS IGA_DLL LIBRARY DESTINATION ${IGA_LIB_PATH} COMPONENT igc-core-devel NAMELINK_ONLY) unset(IGA_LIB_PATH) endif() ``` -------------------------------- ### SBARRIER Usage Examples Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/SBARRIER.md Provides text-based examples for using SBARRIER in 'wait' and 'signal' modes. ```text SBARRIER.wait // barrier wait SBARRIER.signal // barrier signal ``` -------------------------------- ### Example YAML Address Space Configuration Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/IRBuilderGenerator/README.md Provides a concrete example of defining three custom address spaces: RTSAS, RTGAS, and RTShadowAS. ```yaml address_spaces: - name: RTSAS description: RTStack constant: false - name: RTGAS description: RTGlobals constant: true - name: RTShadowAS description: Shadow Memory constant: false ``` -------------------------------- ### Install LLVM, LLD, and Clang on Ubuntu Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/build_ubuntu.md Installs specific versions of LLVM, LLD, and Clang using the apt package manager, which are required for building IGC. ```shell sudo apt-get install llvm-17 llvm-17-dev clang-17 liblld-17 liblld-17-dev libllvmspirvlib17 libllvmspirvlib-17-dev ``` -------------------------------- ### Indirect Addressing Syntax Example Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/8_appendix_visa_assembly_syntax.md Illustrates the syntax for indirect addressing with an example of raw data type access. ```assembly r[A11(0),64]<1>:ud ``` -------------------------------- ### Install lld for 64-bit builds Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Installs the 'lld' target (runtime) to specific directories for 64-bit builds when LLVM sources are enabled and LLD option is set. This is for Release and Debug configurations. ```cmake if(CMAKE_SIZEOF_VOID_P EQUAL 8) # Only copy 64 build if(IGC_BUILD__LLVM_SOURCES AND IGC_OPTION__LLVM_LLD) # For now lld could be included only via building from LLVM sources install(TARGETS lld RUNTIME DESTINATION ../Test_Tools/Release/x64/Standalones CONFIGURATIONS Release) install(TARGETS lld RUNTIME DESTINATION ../Test_Tools/Debug/x64/Standalones CONFIGURATIONS Debug) endif() install(TARGETS ${IGC_BUILD__PROJ__igc_dll} RUNTIME DESTINATION ../Test_Tools/Release/x64/Standalones CONFIGURATIONS Release) install(TARGETS ${IGC_BUILD__PROJ__igc_dll} RUNTIME DESTINATION ../Test_Tools/Debug/x64/Standalones CONFIGURATIONS Debug) endif(CMAKE_SIZEOF_VOID_P EQUAL 8) ``` -------------------------------- ### Example GTReplay Validation Command Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/RA_Validation/README.md An example of the GTReplay validation command with specific paths for shader dump directory and runtime trace. ```bash gtreplay.exe -t Profilers/GTReplay/examples/build/Lib/intel64/ra_validate.dll --shaderDumpDir "C:\Intel\IGC\rodinia-nw.exe_7468" -- GTPIN_PROFILE_GENTRACE1/Session_Final/CS_asmaed32e0839ffdb4e_simd16_aed32e0839ffdb4e_0/device_0__bus_3__bus_0__enqueue_0 ``` -------------------------------- ### Install igc-clang prebuild Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Installs the igc-clang prebuild library to the Debug bin directory for Debug configurations, excluding Production builds. ```cmake if(TARGET igc-clang-lib AND NOT "${PRODUCTION_BUILD}" STREQUAL "True") install(FILES $ DESTINATION Debug/bin CONFIGURATIONS Debug) endif() ``` -------------------------------- ### Install Ubuntu Build Dependencies Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/build_ubuntu.md Installs essential packages like flex, bison, cmake, and Python libraries required for building IGC on Ubuntu. ```shell sudo apt-get install flex bison libz-dev cmake libc6 libstdc++6 libzstd-dev python3-pip sudo python3 -m pip install mako ``` -------------------------------- ### RT Write with Per-Sample Enable Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/RT_WRITE.md Example of an RT write operation with per-sample enable, including render target, source, and color operands. ```assembly // RT write with per-sample enable with r, g, b, a operands // .decl SRFC v_type=T num_elts=77 v_name=TEST rt_write_3d. (8) SRFC UD42.0 F43.0 F40.0 F41.0 F42.0 ``` -------------------------------- ### Install IGA_EXE Target for General Use Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/iga/IGAExe/CMakeLists.txt Installs the IGA_EXE target to the current directory for runtime, library, and archive destinations when IGC_BUILD is not enabled. ```cmake INSTALL(TARGETS IGA_EXE RUNTIME DESTINATION . LIBRARY DESTINATION . ARCHIVE DESTINATION . ) ``` -------------------------------- ### Install IGC DLL PDB files Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Installs the PDB files for the IGC DLL to the Release/pdb directory for Release configurations and to the Debug/pdb directory for Debug configurations. ```cmake install(FILES $ DESTINATION Release/pdb CONFIGURATIONS Release) install(FILES $ DESTINATION Debug/pdb CONFIGURATIONS Debug) ``` -------------------------------- ### Configure and Install IGC Headers and Libraries on UNIX Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt This snippet configures header files and package information, then installs IGC targets, headers, and libraries for UNIX-based systems. It includes conditional installation for FCL and LLVM/lld components. ```cmake set(IGC_PC_PACKAGE_RELEASE "") if(DEFINED IGC_BUILD_METADATA) set(IGC_PC_PACKAGE_RELEASE "-${IGC_BUILD_METADATA}") endif() include(cmake/igc_version.cmake) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/AdaptorOCL/igc.opencl.h.in ${IGC_BUILD__IGC_BIN_DIR}/AdaptorOCL/igc.opencl.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/AdaptorOCL/igc-opencl.pc.in ${IGC_BUILD__IGC_BIN_DIR}/AdaptorOCL/igc-opencl.pc @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/AdaptorOCL/ocl_igc_interface/impl/version_in.h ${IGC_BUILD__IGC_BIN_DIR}/AdaptorOCL/ocl_igc_interface/impl/version.h) if(UNIX) install(TARGETS ${IGC_BUILD__PROJ__igc_dll} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT igc-core NAMELINK_SKIP) install(TARGETS ${IGC_BUILD__PROJ__igc_dll} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT igc-core-devel NAMELINK_ONLY) if (FCL_ENABLED) install(TARGETS ${IGC_BUILD__PROJ__fcl_dll} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT igc-opencl NAMELINK_SKIP) install(TARGETS ${IGC_BUILD__PROJ__fcl_dll} LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT igc-opencl-devel NAMELINK_ONLY) endif() install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/AdaptorOCL/ocl_igc_shared DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/igc COMPONENT igc-opencl-devel) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/AdaptorOCL/ocl_igc_interface DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/igc COMPONENT igc-opencl-devel) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/AdaptorOCL/OCLAPI DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/igc COMPONENT igc-opencl-devel) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/AdaptorOCL/cif DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/igc COMPONENT igc-opencl-devel) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/common/StateSaveAreaHeader.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/igc/common COMPONENT igc-opencl-devel) if(IGC_BUILD__LLVM_SOURCES AND IGC_OPTION__LLVM_LLD) # For now lld could be included only via building from LLVM sources if(NOT CMAKE_BUILD_TYPE STREQUAL "Release") install(TARGETS lld RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT igc-opencl-devel) endif() endif() install( CODE "file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/postinst \"/sbin/ldconfig\n\" )" CODE "file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/postrm \"/sbin/ldconfig\n\" )" CODE "file( COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/postinst DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )" CODE "file( COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/postrm DESTINATION ${CMAKE_CURRENT_BINARY_DIR} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )" COMPONENT igc-core ) install(FILES ${IGC_BUILD__IGC_BIN_DIR}/AdaptorOCL/igc-opencl.pc DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig COMPONENT igc-opencl-devel) install(FILES ${IGC_BUILD__IGC_BIN_DIR}/AdaptorOCL/igc.opencl.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/igc COMPONENT igc-opencl-devel) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../NOTICES.txt) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../NOTICES.txt DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/igc2 COMPONENT igc-core) endif() install(FILES ${IGC_BUILD__VISA_DIR}/include/RelocationInfo.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/visa COMPONENT igc-opencl-devel) install(DIRECTORY ${IGC_BUILD__VISA_DIR}/iga/IGALibrary/api/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/iga COMPONENT igc-core-devel FILES_MATCHING PATTERN "*.h*") install(FILES ${ZEBIN_INCLUDE_PATH}/../ZEELF.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/igc/zebin COMPONENT igc-core-devel) elseif (WIN32) install(TARGETS ${IGC_BUILD__PROJ__igc_dll} RUNTIME DESTINATION Release/bin CONFIGURATIONS Release) install(TARGETS ${IGC_BUILD__PROJ__igc_dll} RUNTIME DESTINATION Debug/bin CONFIGURATIONS Debug) endif() ``` -------------------------------- ### INFO Opcode Usage Examples Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/INFO.md Provides the syntax for using the RESINFO and SAMPLEINFO operations with the INFO opcode, including required operands like execution size, surface, LOD, and destination. ```text RESINFO (exec_size) SAMPLEINFO (exec_size) ``` -------------------------------- ### Install IGA_EXE Target on UNIX Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/iga/IGAExe/CMakeLists.txt Installs the IGA_EXE target to the runtime destination in the bin directory with the 'igc-core-devel' component when IGC_BUILD is enabled and the system is UNIX. ```cmake install(TARGETS IGA_EXE RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT igc-core-devel) ``` -------------------------------- ### Install FCL DLL for enabled FCL Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Installs the FCL DLL and its PDB files for Release and Debug configurations when FCL is enabled and not in Shim mode. ```cmake if (FCL_ENABLED AND (NOT IGC_BUILD__SHIM_MODE STREQUAL "Fallback")) install(TARGETS ${IGC_BUILD__PROJ__fcl_dll} RUNTIME DESTINATION Release/bin CONFIGURATIONS Release) install(TARGETS ${IGC_BUILD__PROJ__fcl_dll} RUNTIME DESTINATION Debug/bin CONFIGURATIONS Debug) install(FILES $ DESTINATION Release/pdb CONFIGURATIONS Release) install(FILES $ DESTINATION Debug/pdb CONFIGURATIONS Debug) endif() ``` -------------------------------- ### C++ Source File with Annotations Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/IRBuilderGenerator/README.md Example C++ source file demonstrating the use of annotations for generating type builders, private IRBuilder functions, and processing data. Ensure necessary headers like BuilderUtils.h and AutoGenMyStruct.h are included. ```cpp #include "BuilderUtils.h" #include "AutoGenMyStruct.h" // Hook declarations - these will be replaced with actual implementations namespace hook { namespace bi { PUREBUILTIN uint32_t getGlobalValue(); BUILTIN void performSideEffect(); } // namespace bi namespace fn { BUILTIN uint32_t getUserFunction(); } // namespace fn } // namespace hook // Generate a type builder function TYPEOF MyStruct _gettype_MyStruct() { return {}; } // Generate IRBuilder instruction sequence CREATE_PRIVATE auto _accessField(MyStructAS MyStruct *ptr) { return ptr->field; } // Call hook functions that will be passed as template parameters CREATE_PRIVATE uint32_t _processData(uint32_t value) { uint32_t global = hook::bi::getGlobalValue(); return hook::fn::getUserFunction(value, global); } ``` -------------------------------- ### Single-configuration Generator Setup Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Handles build type selection for single-configuration generators. It normalizes the input, defaults to 'Release' if unknown or unspecified, and warns about its limited applicability to certain generators. ```cmake if(DEFINED CMAKE_BUILD_TYPE) string(TOLOWER "${CMAKE_BUILD_TYPE}" _buildType) string(STRIP "${_buildType}" _buildType) if(_buildType MATCHES "^release$") set(_buildType "Release") elseif(_buildType MATCHES "^debug$") set(_buildType "Debug") else() set(_buildType "Release") message(WARNING "CMAKE_BUILD_TYPE: Unknown build configuration. The following configurations are available: ${IGC_CMAKE_CONFIGURATION_TYPES}.\nThe \"${_buildType}\" configuration will be used.\nThis value has meaning only for single-configuration generators (like Make). It will be ignored for MSVC/XCode.") endif() else() set(_buildType "Release") message(WARNING "CMAKE_BUILD_TYPE: No build configuration specified. The following configurations are available: ${IGC_CMAKE_CONFIGURATION_TYPES}.\nThe \"${_buildType}\" configuration will be used.\nThis value has meaning only for single-configuration generators (like Make). It will be ignored for MSVC/XCode.") endif() set(CMAKE_BUILD_TYPE "${_buildType}") unset(_buildType) ``` -------------------------------- ### Install IGA on MSVC (Windows) Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/iga/IGALibrary/CMakeLists.txt Installs the IGA DLL and its PDB file on Windows systems using MSVC. It specifies different destination paths based on Release, ReleaseInternal, and Debug configurations. ```cmake elseif(MSVC) install(TARGETS IGA_DLL RUNTIME DESTINATION Release/bin CONFIGURATIONS Release) install(TARGETS IGA_DLL RUNTIME DESTINATION Release-Internal/bin CONFIGURATIONS ReleaseInternal) install(TARGETS IGA_DLL RUNTIME DESTINATION Debug/bin CONFIGURATIONS Debug) install(FILES $ DESTINATION Release/pdb CONFIGURATIONS Release) install(FILES $ DESTINATION Release-Internal/pdb CONFIGURATIONS ReleaseInternal) install(FILES $ DESTINATION Debug/pdb CONFIGURATIONS Debug) endif() ``` -------------------------------- ### FCVT Semantics Example Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/FCVT.md Illustrates the core logic of the FCVT operation, showing how elements are copied from source to destination based on channel enablement. ```C++ for (i = 0; i < exec_size; ++i) { if (ChEn[i]) { // ChEn[i] is always true if dst has FP8 type dst[i] = src0[i]; } } ``` -------------------------------- ### URB_WRITE Opcode Usage Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/URB_WRITE.md This is a general syntax example for the URB_WRITE opcode. It shows how to specify execution mask, number of output parameters, global offset, channel mask, URB handle, per-slot offset, and vertex data. ```assembly [(

)] URB_WRITE (M1, 8) // is an integer representing the bit mask value ``` -------------------------------- ### LABEL Opcode Description Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/LABEL.md Explains how to use the LABEL opcode to create a new basic block starting at a specified label. ```text Create a new basic block starting at

)] {raw_send|raw_sendc} () ``` -------------------------------- ### Add Custom Validation Tool to GTReplay Examples Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/RA_Validation/README.md Modify the CMakeLists.txt file to include the 'ra_validate' tool in the GTReplay examples build. This involves updating the list of examples and adding specific build commands for the custom library. ```cmake set ( GTREPLAY_EXAMPLES icount imix ops mem toggle bvaltrace ra_validate) ``` ```cmake add_library( ra_validate SHARED ra_validate.cpp) ``` ```cmake set_property(TARGET ra_validate PROPERTY POSITION_INDEPENDENT_CODE ON) ``` -------------------------------- ### GOTO Opcode Notes - Convergence and Uniform Branch Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/GOTO.md Highlights the application's responsibility for ensuring control flow convergence and explains the effect of a of 1 for uniform branching. ```text It is the application's responsibility to ensure that divergent control flow due to the goto instructions will converge eventually. The label must be in the same subroutine as the goto. A of 1 indicates that the branch is uniform, and all channels would either branch or not based on the predicate value. ``` -------------------------------- ### Project and Runtime Configuration Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/iga/IGAExe/CMakeLists.txt Sets the project name and configures the Windows runtime library based on the LINK_AS_STATIC_LIB variable. ```cmake project(IGA_EXE) if (LINK_AS_STATIC_LIB) win_static_runtime() else (LINK_AS_STATIC_LIB) win_dynamic_runtime() endif (LINK_AS_STATIC_LIB) ``` -------------------------------- ### Set IGC Install Root Directory Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Configures the root directory for IGC installation. It uses an explicit option if provided, otherwise defaults to CMAKE_INSTALL_PREFIX. ```cmake if(IGC_OPTION__INSTALL_TIME_ROOT_DIR) get_filename_component(IGC_INSTALL_TIME_ROOT_DIR ${IGC_OPTION__INSTALL_TIME_ROOT_DIR} ABSOLUTE) else() set(IGC_INSTALL_TIME_ROOT_DIR ${CMAKE_INSTALL_PREFIX}) endif() ``` -------------------------------- ### Collect Runtime Trace with GTPin Gentrace (Phase 1) Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/RA_Validation/README.md Use this command to initiate the first phase of collecting a runtime trace of your application with GTPin Gentrace. Ensure the path to gtpin.exe is correct. ```bash Profilers/Bin/gtpin.exe -t gentrace.dll --phase 1 -- ``` -------------------------------- ### vISA Branch Instructions: If-Else and Do-While Loop Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/3_execution_model.md Demonstrates the use of 'goto' instructions to implement conditional logic (if-else-endif) and loops (do-while). Pay attention to the use of predicate registers (P1, P2) and labels for control flow. ```assembly cmp.ne (8) P1 V1(0,0)<8;8,1> 0 (!P1) goto (8) ELSE1 ... cmp.gt (8) P2 V2(0,0)<8;8,1> 1:ud (!P2) goto ENDIF2 addr_add (1) A1(0)<1> A0(0)<1> 4:uw {NoMask} mov (8) [A1(0), 0]<1> 0:ud ENDIF2: goto (8) ENDIF1 ELSE1: ... ENDIF1: LOOP_START: ... cmp.eq (16) P2 V2(0,0)<8;8,1> 0:ud (P2) goto (16) LOOP_END ... cmp.gt (16) P1 V1(0,0)<8;8,1> 0:ud (P1) goto (16) LOOP_START LOOP_END: ``` -------------------------------- ### Configure IGA_DLL for IGC and MSVC Builds Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/iga/IGALibrary/CMakeLists.txt Sets up standard defines from the WDK path and adds a post-build command to copy the IGA_DLL and its PDB file for IGC and MSVC builds. ```cmake if(IGC_BUILD AND MSVC) # set up standard defines from the common WDK path. bs_set_wdk(IGA_DLL) add_custom_command(TARGET IGA_DLL POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy $ $ COMMAND "${CMAKE_COMMAND}" -E copy $ $ ) endif() ``` -------------------------------- ### Get LLVM Targets Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/VectorCompiler/lib/Driver/CMakeLists.txt Retrieves a list of LLVM target libraries to be linked. ```cmake igc_get_llvm_targets(LLVM_LIBS Analysis BitReader Core Support CodeGen ipo ) ``` -------------------------------- ### Reg Object Example Source: https://github.com/intel/intel-graphics-compiler/blob/master/visa/iga/IGAJSONv1.md Represents a bare register with its name, number, and subregister number. ```json {"rn":"f","r":2,"sr":1} ``` ```json {"rn":"r","r":12,"sr":4} ``` -------------------------------- ### CALL Opcode Syntax Source: https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/CALL.md Illustrates the general syntax for using the CALL opcode in assembly. ```Assembly [(

)] CALL ()

)] SAMPLE4[.pixel_null_mask]. (Exec_size) ``` ```assembly [(

)] SAMPLE4_C[.pixel_null_mask]. (Exec_size) ``` ```assembly [(

)] SAMPLE4_PO[.pixel_null_mask]. (Exec_size) ``` ```assembly [(

)] SAMPLE4_PO_C[.pixel_null_mask]. (Exec_size) ``` ```assembly [(

)] SAMPLE4_b[.pixel_null_mask]. (Exec_size) ``` ```assembly [(

)] SAMPLE4_l[.pixel_null_mask]. (Exec_size) ``` ```assembly [(

)] SAMPLE4_i[.pixel_null_mask]. (Exec_size) ``` -------------------------------- ### Architecture Detection and Validation Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/CMakeLists.txt Uses custom CMake macros `igc_arch_detect` and `igc_arch_validate` to determine and validate the target and host architectures for the build. This is crucial for cross-compilation setups. ```cmake igc_arch_detect(IGC_BUILD__DETECTED_ARCHITECTURE_TARGET IGC_BUILD__DETECTED_ARCHITECTURE_HOST) igc_arch_validate(_detectedTargetArchValid "${IGC_BUILD__DETECTED_ARCHITECTURE_TARGET}") igc_arch_validate(_detectedHostArchValid "${IGC_BUILD__DETECTED_ARCHITECTURE_HOST}") ``` -------------------------------- ### Configure Source Files and Build Static Library Source: https://github.com/intel/intel-graphics-compiler/blob/master/IGC/Compiler/CMakeLists.txt This snippet iterates through source files, conditionally disabling precompiled headers for .c files. It then defines a static library with specified source and header files. ```cmake foreach(src_file ${IGC_BUILD__SRC__Compiler}) get_filename_component(file_ext ${src_file} EXT) if(${file_ext} STREQUAL ".c") set_source_files_properties(${src_file} PROPERTIES SKIP_PRECOMPILE_HEADERS ON) endif() endforeach() add_library("${IGC_BUILD__PROJ__Compiler}" STATIC ${IGC_BUILD__SRC__Compiler} ${IGC_BUILD__SRC_Win_Lin_Dar__Compiler} ${IGC_BUILD__HDR__Compiler} ${IGC_BUILD__HDR_Win_Lin_Dar__Compiler} ) ```