Skip to content

Commit 41ee7a1

Browse files
JoshuaBarczak-AMDkurbeco
authored andcommitted
DGF-SDK v1.0.0
0 parents  commit 41ee7a1

93 files changed

Lines changed: 86118 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# This file is part of the the DGF-SDK.
2+
#
3+
# Copyright (C) 2025 Advanced Micro Devices, Inc.
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files(the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions :
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
23+
cmake_minimum_required(VERSION 3.5)
24+
project(DGFSDK)
25+
26+
# Check if DGF is used as main project or just consumed as libary with add_subdirectory
27+
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
28+
set(DGF_IS_TOP_LEVEL ON)
29+
else()
30+
set(DGF_IS_TOP_LEVEL OFF)
31+
endif()
32+
33+
34+
if( DGF_IS_TOP_LEVEL )
35+
message( STATUS "DGFSDK: Top-level build detected" )
36+
37+
# We're the root project, build everything
38+
set( DGF_BUILD_DGFLIB 1 )
39+
set( DGF_BUILD_DGFBAKER 1 )
40+
set( DGF_BUILD_DGFTESTER 1 )
41+
set( DGF_BUILD_SAMPLES 1 )
42+
else()
43+
44+
# we're a client of somebody else's project, let them control what they want
45+
# by default, build only 'DGFLib'
46+
message( STATUS "DGFSDK: Library build detected" )
47+
48+
if( NOT DEFINED DGF_BUILD_DGFTESTER )
49+
set( DGF_BUILD_DGFTESTER 0 )
50+
message( STATUS "DGF_BUILD_DGFLIB not set, setting to ${DGF_BUILD_DGFTESTER}")
51+
endif()
52+
53+
if( NOT DEFINED DGF_BUILD_SAMPLES )
54+
set( DGF_BUILD_SAMPLES 0 )
55+
message( STATUS "DGF_BUILD_SAMPLES not seat, setting to ${DGF_BUILD_SAMPLES}")
56+
endif()
57+
58+
if( NOT DEFINED DGF_BUILD_DGFLIB )
59+
set( DGF_BUILD_DGFLIB 1 )
60+
message( STATUS "DGF_BUILD_DGFLIB not set, setting to ${DGF_BUILD_DGFLIB}")
61+
endif()
62+
63+
if( NOT DEFINED DGF_BUILD_DGFBAKER )
64+
set( DGF_BUILD_DGFBAKER 0 )
65+
message( STATUS "DGF_BUILD_DGFBAKER not set, setting to ${DGF_BUILD_DGFBAKER}")
66+
endif()
67+
endif()
68+
69+
# DGFTester and Samples depend on DGFBaker
70+
if( DGF_BUILD_SAMPLES OR DGF_BUILD_DGFTESTER )
71+
set( DGF_BUILD_DGFBAKER 1 )
72+
set( DGF_BUILD_DGFLIB 1 )
73+
endif()
74+
75+
# DGFBaker depends on DGFLib
76+
if( DGF_BUILD_DGFBAKER )
77+
set( DGF_BUILD_DGFLIB 1 )
78+
endif()
79+
80+
add_subdirectory(external)
81+
82+
if( DGF_BUILD_DGFLIB )
83+
set( DGF_LIB_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/DGFLib )
84+
add_subdirectory(DGFLib)
85+
endif()
86+
if( DGF_BUILD_DGFBAKER )
87+
add_subdirectory(DGFBaker)
88+
endif()
89+
if( DGF_BUILD_DGFTESTER )
90+
add_subdirectory(DGFTester)
91+
endif()
92+
if( DGF_BUILD_SAMPLES )
93+
add_subdirectory(DGFSample)
94+
endif()

DGFBaker/CMakeLists.txt

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This file is part of the the DGF-SDK.
2+
#
3+
# Copyright (C) 2025 Advanced Micro Devices, Inc.
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files(the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions :
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
23+
set( DGF_BAKER_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
24+
25+
set( DGF_BAKER_API ${DGF_BAKER_DIR}/include/DGFBaker.h )
26+
27+
set( DGF_BAKER_SOURCES
28+
${DGF_BAKER_DIR}/source/Utils.h
29+
${DGF_BAKER_DIR}/source/ClusterBuilder.h
30+
${DGF_BAKER_DIR}/source/ClusterBuilder.cpp
31+
${DGF_BAKER_DIR}/source/Cluster.h
32+
${DGF_BAKER_DIR}/source/Quantization.h
33+
${DGF_BAKER_DIR}/source/Quantization.cpp
34+
${DGF_BAKER_DIR}/source/HPG24BlockPacker.h
35+
${DGF_BAKER_DIR}/source/HPG24BlockPacker.cpp
36+
${DGF_BAKER_DIR}/source/DebugOutput.h
37+
${DGF_BAKER_DIR}/source/DebugOutput.cpp
38+
${DGF_BAKER_DIR}/source/AdjacencyGraph.h
39+
${DGF_BAKER_DIR}/source/StripGeneration.h
40+
${DGF_BAKER_DIR}/source/StripGeneration.cpp
41+
${DGF_BAKER_DIR}/source/MaterialCompression.h
42+
${DGF_BAKER_DIR}/source/DGFBaker.cpp
43+
${DGF_BAKER_DIR}/source/SAHBlockPacker.h
44+
${DGF_BAKER_DIR}/source/SAHBlockPacker.cpp
45+
${DGF_BAKER_DIR}/source/SIMD.h
46+
)
47+
48+
add_library( DGFBaker STATIC ${DGF_BAKER_SOURCES} ${DGF_BAKER_API} )
49+
50+
target_include_directories( DGFBaker
51+
PUBLIC ${DGF_LIB_ROOT}
52+
PUBLIC ${DGF_BAKER_DIR}/include )
53+
54+
55+
56+
source_group( api ${DGF_BAKER_API} )
57+
source_group( src ${DGF_BAKER_SOURCES} )
58+
source_group( autogen "cxx|hxx" )
59+
60+
set_property(TARGET DGFBaker PROPERTY CXX_STANDARD 20)

0 commit comments

Comments
 (0)