Skip to content

Commit a4d396e

Browse files
authored
Merge pull request #113 from GPUOpen-LibrariesAndSDKs/feature/ORO-0-precomp-2
improve management of build flags for the precompiled/baked use-case
2 parents e8da229 + abbd1ed commit a4d396e

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

ParallelPrimitives/RadixSort.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,22 @@
2727
#include <iostream>
2828
#include <numeric>
2929

30-
#if defined( ORO_PP_LOAD_FROM_STRING )
31-
30+
// if ORO_PP_LOAD_FROM_STRING && ORO_PRECOMPILED -> we load the precompiled/baked kernels.
31+
// if ORO_PP_LOAD_FROM_STRING && NOT ORO_PRECOMPILED -> we load the baked source code kernels (from Kernels.h / KernelArgs.h)
32+
#if !defined( ORO_PRECOMPILED ) && defined( ORO_PP_LOAD_FROM_STRING )
3233
// Note: the include order must be in this particular form.
3334
// clang-format off
3435
#include <ParallelPrimitives/cache/Kernels.h>
3536
#include <ParallelPrimitives/cache/KernelArgs.h>
3637
// clang-format on
38+
#else
39+
// if Kernels.h / KernelArgs.h are not included, declare nullptr strings
40+
static const char* hip_RadixSortKernels = nullptr;
41+
namespace hip
42+
{
43+
static const char** RadixSortKernelsArgs = nullptr;
44+
static const char** RadixSortKernelsIncludes = nullptr;
45+
}
3746
#endif
3847

3948
#if defined( __GNUC__ )
@@ -73,12 +82,6 @@ namespace
7382
constexpr auto useBakeKernel = true; // this flag means we use the HIP source code embeded in the binary ( as a string )
7483
#else
7584
constexpr auto useBakeKernel = false;
76-
static const char* hip_RadixSortKernels = nullptr;
77-
namespace hip
78-
{
79-
static const char** RadixSortKernelsArgs = nullptr;
80-
static const char** RadixSortKernelsIncludes = nullptr;
81-
} // namespace hip
8285
#endif
8386

8487
#endif

0 commit comments

Comments
 (0)