Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promotion from AMD internal branch for 2023.Q3.3 #2735

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ if(ICD_BUILD_LLPC)
add_subdirectory(llpc ${PROJECT_BINARY_DIR}/llpc)

if(LLPC_BUILD_TESTS)
set(LLVM_INCLUDE_TESTS ON CACHE BOOL "Force enable LLVM_INCLUDE_TESTS to include gmock" FORCE)
add_subdirectory(test)
endif()

Expand All @@ -151,3 +152,62 @@ if(ICD_BUILD_LLPC)

target_link_libraries(vkgc INTERFACE llpc)
endif()

# Set sub library properties
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")

if (TARGET dumper)
set_property(TARGET dumper_base PROPERTY FOLDER Compiler)
set_property(TARGET dumper PROPERTY FOLDER Compiler)
endif()

if (TARGET vfx)
set_property(TARGET vfx PROPERTY FOLDER Compiler)
endif()

if(ICD_BUILD_LLPC)
set_property(TARGET llpc PROPERTY FOLDER Compiler)
set_property(TARGET llpcinternal PROPERTY FOLDER Compiler)
if(VKI_RAY_TRACING AND NOT LLPC_IS_STANDALONE)
set_property(TARGET vkgc_gpurtshim PROPERTY FOLDER Compiler)
endif()
set_property(TARGET vkgc_util PROPERTY FOLDER Compiler)
if (LLPC_BUILD_TOOLS)
set_property(TARGET amdllpc PROPERTY FOLDER Compiler)
endif()

set_property(TARGET all-targets PROPERTY FOLDER Misc)
set_property(TARGET AMDGPU PROPERTY FOLDER Misc)
set_property(TARGET benchmark PROPERTY FOLDER Misc)
set_property(TARGET benchmark_main PROPERTY FOLDER Misc)
set_property(TARGET distribution PROPERTY FOLDER Misc)
set_property(TARGET Engine PROPERTY FOLDER Misc)
set_property(TARGET install-distribution PROPERTY FOLDER Misc)
set_property(TARGET install-distribution-stripped PROPERTY FOLDER Misc)
set_property(TARGET LLVMSupportBlake3 PROPERTY FOLDER Misc)
set_property(TARGET Native PROPERTY FOLDER Misc)
set_property(TARGET NativeCodeGen PROPERTY FOLDER Misc)
set_property(TARGET opt-viewer PROPERTY FOLDER Misc)
if (TARGET llvm-dialects-example)
set_property(TARGET llvm-dialects-example PROPERTY FOLDER Misc)
endif()
if (LLVM_OPTIMIZED_TABLEGEN)
set_property(TARGET llvm_nm_target PROPERTY FOLDER Misc)
set_property(TARGET llvm_readobj_target PROPERTY FOLDER Misc)
set_property(TARGET llvm-min-tblgen-host PROPERTY FOLDER Misc)
set_property(TARGET llvm-tblgen-host PROPERTY FOLDER Misc)
set_property(TARGET CONFIGURE_LLVM_NATIVE PROPERTY FOLDER Misc)
set_property(TARGET CREATE_LLVM_NATIVE PROPERTY FOLDER Misc)
endif()
if (LLPC_BUILD_TESTS)
set_property(TARGET check-all PROPERTY FOLDER Tests)
if(NOT LLPC_IS_STANDALONE)
set_property(TARGET check-amber PROPERTY FOLDER "LLPC Tests")
endif()
set_property(TARGET check-amdllpc PROPERTY FOLDER "LLPC Tests")
set_property(TARGET check-amdllpc-units PROPERTY FOLDER "LLPC Tests")
set_property(TARGET check-lgccps-units PROPERTY FOLDER "LgcCps Tests")
set_property(TARGET check-lgc-units PROPERTY FOLDER "LGC Tests")
endif()
endif()
endif()
9 changes: 6 additions & 3 deletions cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
function(set_compiler_options PROJECT_NAME ENABLE_WERROR)
target_compile_features("${PROJECT_NAME}" PUBLIC cxx_std_17)
set_target_properties("${PROJECT_NAME}" PROPERTIES CXX_EXTENSIONS OFF)
set_target_properties("${PROJECT_NAME}" PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
POSITION_INDEPENDENT_CODE ON)

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
if(ENABLE_WERROR)
Expand Down
43 changes: 43 additions & 0 deletions cmake/continuations.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
##
#######################################################################################################################
#
# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
#######################################################################################################################

set(LLPC_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/..")

# Function to add continuations and its dependencies as LLVM external projects.
# This appends the project names to LLVM_EXTERNAL_PROJECTS and sets each LLVM_EXTERNAL_*_SOURCE_DIR,
# all in the caller's scope.
function(add_continuations_projects)
if (NOT "${LLVM_EXTERNAL_CONTINUATIONS_SOURCE_DIR}")
if (NOT "${LLVM_EXTERNAL_LLVM_DIALECTS_SOURCE_DIR}")
list(APPEND LLVM_EXTERNAL_PROJECTS llvm_dialects)
set(LLVM_EXTERNAL_LLVM_DIALECTS_SOURCE_DIR "${LLPC_SOURCE_DIR}/imported/llvm-dialects" PARENT_SCOPE)
endif()
list(APPEND LLVM_EXTERNAL_PROJECTS lgccps lgcrt continuations)
set(LLVM_EXTERNAL_CONTINUATIONS_SOURCE_DIR "${LLPC_SOURCE_DIR}/shared/continuations" PARENT_SCOPE)
set(LLVM_EXTERNAL_LGCRT_SOURCE_DIR "${LLPC_SOURCE_DIR}/shared/lgcrt" PARENT_SCOPE)
set(LLVM_EXTERNAL_LGCCPS_SOURCE_DIR "${LLPC_SOURCE_DIR}/shared/lgccps" PARENT_SCOPE)
set(LLVM_EXTERNAL_PROJECTS "${LLVM_EXTERNAL_PROJECTS}" PARENT_SCOPE)
endif()
endfunction()
4 changes: 3 additions & 1 deletion cmake/lgc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ function(add_lgc_projects)
list(APPEND LLVM_EXTERNAL_PROJECTS llvm_dialects)
set(LLVM_EXTERNAL_LLVM_DIALECTS_SOURCE_DIR "${LLPC_SOURCE_DIR}/imported/llvm-dialects" PARENT_SCOPE)
endif()
list(APPEND LLVM_EXTERNAL_PROJECTS LgcCps lgc)
list(APPEND LLVM_EXTERNAL_PROJECTS LgcCps LgcRt Continuations lgc)
set(LLVM_EXTERNAL_PROJECTS "${LLVM_EXTERNAL_PROJECTS}" PARENT_SCOPE)
set(LLVM_EXTERNAL_LGCCPS_SOURCE_DIR "${LLPC_SOURCE_DIR}/shared/lgccps" PARENT_SCOPE)
set(LLVM_EXTERNAL_LGCRT_SOURCE_DIR "${LLPC_SOURCE_DIR}/shared/lgcrt" PARENT_SCOPE)
set(LLVM_EXTERNAL_CONTINUATIONS_SOURCE_DIR "${LLPC_SOURCE_DIR}/shared/continuations" PARENT_SCOPE)
set(LLVM_EXTERNAL_LGC_SOURCE_DIR "${LLPC_SOURCE_DIR}/lgc" PARENT_SCOPE)
endif()
endfunction()
Loading