-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpremake5.lua
More file actions
883 lines (718 loc) · 22.9 KB
/
premake5.lua
File metadata and controls
883 lines (718 loc) · 22.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
-- Global configuration variables
cudaProjects = false
openClProjects = false
vulkanProjects = false
cppProjects = false
-- Helper functions to find and link compute API headers and libraries
function linkLibrariesAmd()
local path = os.getenv("OCL_ROOT")
if not path then
return false
end
defines {"KTT_PLATFORM_AMD"}
includedirs {"$(OCL_ROOT)/include"}
if os.target() == "linux" then
libdirs {"$(OCL_ROOT)/lib64"}
else
libdirs {"$(OCL_ROOT)/lib/x86_64"}
end
if _OPTIONS["no-opencl"] then
return true
end
defines {"KTT_API_OPENCL"}
defines {"CL_TARGET_OPENCL_VERSION=300"}
links {"OpenCL"}
openClProjects = true
if _OPTIONS["profiling"] == "gpa" then
defines {"KTT_PROFILING_GPA"}
includedirs {"Libraries/GpuPerfApi-3.6/Include"}
if os.target() == "linux" then
libdirs {"Libraries/GpuPerfApi-3.6/Lib/Linux"}
else
-- One of the GPA headers includes Windows.h with evil min/max macros
defines {"NOMINMAX"}
libdirs {"Libraries/GpuPerfApi-3.6/Lib/Windows"}
end
elseif _OPTIONS["profiling"] == "gpa-legacy" then
defines {"KTT_PROFILING_GPA_LEGACY"}
includedirs {"Libraries/GpuPerfApi-3.3/Include"}
if os.target() == "linux" then
libdirs {"Libraries/GpuPerfApi-3.3/Lib/Linux"}
else
defines {"NOMINMAX"}
libdirs {"Libraries/GpuPerfApi-3.3/Lib/Windows"}
end
end
return true
end
function linkLibrariesIntel()
local path = os.getenv("INTELOCLSDKROOT")
if not path then
return false
end
defines {"KTT_PLATFORM_INTEL"}
includedirs {"$(INTELOCLSDKROOT)/include"}
if os.target() == "linux" then
libdirs {"$(INTELOCLSDKROOT)/lib64"}
else
libdirs {"$(INTELOCLSDKROOT)/lib/x64"}
end
if _OPTIONS["no-opencl"] then
return true
end
defines {"KTT_API_OPENCL"}
defines {"CL_TARGET_OPENCL_VERSION=300"}
links {"OpenCL"}
openClProjects = true
return true
end
function linkLibrariesNvidia()
local path = os.getenv("CUDA_PATH")
if not path then
return false
end
defines {"KTT_PLATFORM_NVIDIA"}
includedirs {"$(CUDA_PATH)/include"}
if os.target() == "linux" then
libdirs {"$(CUDA_PATH)/lib64", "$(CUDA_PATH)/lib64/stubs"}
else
libdirs {"$(CUDA_PATH)/lib/x64", "$(CUDA_PATH)/lib/x64/stubs"}
end
if not _OPTIONS["no-opencl"] then
defines {"KTT_API_OPENCL"}
defines {"CL_TARGET_OPENCL_VERSION=300"}
links {"OpenCL"}
openClProjects = true
end
if not _OPTIONS["no-cuda"] then
defines {"KTT_API_CUDA"}
links {"cuda", "nvrtc"}
cudaProjects = true
if _OPTIONS["power-usage"] then
defines {"KTT_POWER_USAGE_NVML"}
links {"nvidia-ml"}
end
if _OPTIONS["profiling"] == "cupti-legacy" or _OPTIONS["profiling"] == "cupti" or _OPTIONS["power-usage"] then
includedirs {"$(CUDA_PATH)/extras/CUPTI/include"}
libdirs {"$(CUDA_PATH)/extras/CUPTI/lib64"}
links {"cupti"}
end
if _OPTIONS["profiling"] == "cupti-legacy" then
defines {"KTT_PROFILING_CUPTI_LEGACY"}
if os.target() == "windows" then
libdirs {"$(CUDA_PATH)/extras/CUPTI/libx64"}
end
elseif _OPTIONS["profiling"] == "cupti" then
defines {"KTT_PROFILING_CUPTI"}
links {"nvperf_host", "nvperf_target"}
end
end
return true
end
function linkCpp()
defines {"KTT_API_CPP"}
cppProjects = true
return true
end
-- Helper function to enable OpenMP support in a cross-platform manner
function enableOpenMP()
filter "system:linux or system:macosx"
buildoptions {"-fopenmp"}
linkoptions {"-fopenmp"}
filter "system:windows"
buildoptions {"/openmp"}
filter {}
end
function linkComputeLibraries()
if _OPTIONS["platform"] then
if _OPTIONS["platform"] == "amd" then
return linkLibrariesAmd()
elseif _OPTIONS["platform"] == "intel" then
return linkLibrariesIntel()
elseif _OPTIONS["platform"] == "nvidia" then
return linkLibrariesNvidia()
else
error("The specified platform is unknown.")
end
end
local retVal = false
if _OPTIONS["cpp"] then
linkCpp()
retVal = true
end
if linkLibrariesAmd() then
retVal = true
end
if linkLibrariesIntel() then
retVal = true
end
if linkLibrariesNvidia() then
retVal = true
end
return retVal
end
function linkVulkan()
local path = os.getenv("VULKAN_SDK")
if not path then
return false
end
defines {"KTT_API_VULKAN"}
includedirs {"Libraries/VulkanMemoryAllocator-2.3.0"}
files {"Libraries/VulkanMemoryAllocator-2.3.0/**"}
if os.target() == "linux" then
includedirs {"$(VULKAN_SDK)/include"}
libdirs {"$(VULKAN_SDK)/lib"}
else
includedirs {"$(VULKAN_SDK)/Include"}
libdirs {"$(VULKAN_SDK)/Lib"}
end
links {"shaderc_shared"}
if os.target() == "linux" then
links {"vulkan"}
else
links {"vulkan-1"}
end
vulkanProjects = true
return true
end
function linkPython()
local pythonHeaders = os.getenv("PYTHON_HEADERS")
local pythonLibrary = os.getenv("PYTHON_LIB")
if not pythonHeaders or not pythonLibrary then
return false
end
defines {"KTT_PYTHON"}
includedirs {pythonHeaders, "Libraries/pybind11-3.0.1"}
files {"Libraries/pybind11-3.0.1/**"}
if os.target() == "windows" then
pythonLibrary = pythonLibrary:gsub("\\", "/")
end
local libraryPath = path.getdirectory(pythonLibrary)
libdirs {libraryPath}
local libraryName = path.getbasename(pythonLibrary)
if os.target() == "linux" and string.startswith(libraryName, "lib") then
libraryName = libraryName:sub(4)
end
links {libraryName}
return true
end
function linkAllLibraries()
local librariesFound = linkComputeLibraries()
-- Allow usage of KTT with only Vulkan or C++ if no other compute API was explicitly specified by user
if not librariesFound and (not _OPTIONS["vulkan"] or _OPTIONS["platform"]) and not _OPTIONS["cpp"] then
error("Compute API libraries were not found. Please ensure that path to the SDK is correctly set in the environment variables:\nOCL_ROOT for AMD\nINTELOCLSDKROOT for Intel\nCUDA_PATH for Nvidia\nor add parameter --cpp to build C++ backend")
end
if _OPTIONS["vulkan"] then
local vulkanFound = linkVulkan()
if not vulkanFound then
error("Vulkan SDK was not found. Please ensure that path to the SDK is correctly set in the environment variables under VULKAN_SDK.")
end
end
if _OPTIONS["python"] then
local pythonFound = linkPython()
if not pythonFound then
error("Python installation was not found. Please ensure that paths to Python headers and Python library (including library name) are correctly set in the environment variables under PYTHON_HEADERS and PYTHON_LIB.")
end
end
end
-- Command line arguments definition
newoption
{
trigger = "platform",
value = "vendor",
description = "Specifies platform for KTT library compilation",
allowed =
{
{"amd", "AMD"},
{"intel", "Intel"},
{"nvidia", "Nvidia"}
}
}
newoption
{
trigger = "vulkan",
description = "Enables compilation of Vulkan backend"
}
newoption
{
trigger = "cpp",
description = "Enables compilation of C++ backend (CPU execution)"
}
newoption
{
trigger = "profiling",
value = "library",
description = "Enables compilation of kernel profiling functionality using specified library",
allowed =
{
{"cupti", "Nvidia CUPTI for Volta, Turing and Ampere"},
{"cupti-legacy", "Nvidia CUPTI for legacy GPUs (Volta and older)"},
{"gpa", "AMD GPA for GCN 3.0 GPUs and newer"},
{"gpa-legacy", "AMD GPA for GCN 5.0 GPUs and older"}
}
}
newoption
{
trigger = "power-usage",
description = "Enables compilation of device power usage collection functionality"
}
newoption
{
trigger = "power-usage-mintime",
description = "Sets how long is the kernel repeated to obtain reliable power measurement, in miliseconds. THIS IS AN EXPERIMENTAL FEATURE, enforcing repeating the kernel without cleaning or changing input/output."
}
newoption
{
trigger = "python",
description = "Enables compilation of Python bindings"
}
newoption
{
trigger = "tuning-loader",
description = "Enables compilation of tuning loader and tuning launcher"
}
newoption
{
trigger = "outdir",
value = "path",
description = "Specifies output directory for generated project files"
}
newoption
{
trigger = "tests",
description = "Enables compilation of unit tests"
}
newoption
{
trigger = "no-cuda",
description = "Disables compilation of CUDA backend (Nvidia platform only)"
}
newoption
{
trigger = "no-opencl",
description = "Disables compilation of OpenCL backend"
}
newoption
{
trigger = "no-examples",
description = "Disables compilation of examples"
}
newoption
{
trigger = "no-tutorials",
description = "Disables compilation of tutorials"
}
-- Project configuration
workspace "Ktt"
local buildPath = "Build"
if _OPTIONS["outdir"] then
buildPath = _OPTIONS["outdir"]
end
configurations {"Release", "Debug"}
platforms {"x86_64"}
architecture "x86_64"
location(buildPath)
language "C++"
cppdialect "C++17"
warnings "Extra"
filter "configurations:Debug"
defines {"KTT_CONFIGURATION_DEBUG"}
optimize "Off"
symbols "On"
filter "configurations:Release"
defines {"KTT_CONFIGURATION_RELEASE"}
optimize "Full"
symbols "Off"
filter "action:vs*"
conformancemode "On"
buildoptions {"/Zc:__cplusplus"}
filter {}
targetdir(buildPath .. "/%{cfg.platform}_%{cfg.buildcfg}")
objdir(buildPath .. "/%{cfg.platform}_%{cfg.buildcfg}/obj")
-- Library configuration
project "Ktt"
kind "SharedLib"
files
{
"Source/**",
"Libraries/CTPL-Ahajha/**",
"Libraries/date-3/**",
"Libraries/Json-3.9.1/**",
"Libraries/pugixml-1.11.4/**"
}
includedirs
{
"Source",
"Libraries/CTPL-Ahajha",
"Libraries/date-3",
"Libraries/Json-3.9.1",
"Libraries/pugixml-1.11.4"
}
if _OPTIONS["python"] then
if os.target() == "linux" then
postbuildcommands {"{COPYFILE} %{cfg.targetdir}/libktt.so %{cfg.targetdir}/pyktt.so"}
else
postbuildcommands {"{COPYFILE} %{cfg.targetdir}/ktt.dll %{cfg.targetdir}/pyktt.pyd"}
end
end
defines {"KTT_LIBRARY"}
targetname("ktt")
linkAllLibraries()
-- Tuning loader and launcher
if _OPTIONS["tuning-loader"] then
if not _OPTIONS["python"] then
error("Tuning loader depends on KTT Python integration (specified with --python option).")
end
project "KttTuningLoader"
kind "SharedLib"
files
{
"TuningLoader/**",
"Libraries/Json-3.9.1/**",
"Libraries/JsonSchemaValidator-2.1.0/**"
}
removefiles {"TuningLoader/TuningLauncher.cpp"}
includedirs
{
"TuningLoader",
"Libraries/Json-3.9.1",
"Libraries/JsonSchemaValidator-2.1.0",
"Source"
}
defines {"KTT_LOADER_LIBRARY"}
links {"ktt"}
project "KttTuningLauncher"
kind "ConsoleApp"
files {"TuningLoader/TuningLauncher.cpp"}
includedirs {"TuningLoader"}
links {"KttTuningLoader"}
end -- _OPTIONS["tuning-loader"]
-- Tutorials configuration
if not _OPTIONS["no-tutorials"] then
if openClProjects then
project "01InfoOpenCl"
kind "ConsoleApp"
files {"Tutorials/01ComputeApiInfo/ComputeApiInfoOpenCl.cpp"}
includedirs {"Source"}
links {"ktt"}
project "02KernelRunningOpenCl"
kind "ConsoleApp"
files {"Tutorials/02KernelRunning/KernelRunningOpenCl.cpp", "Tutorials/02KernelRunning/OpenClKernel.cl"}
includedirs {"Source"}
links {"ktt"}
project "03KernelTuningOpenCl"
kind "ConsoleApp"
files {"Tutorials/03KernelTuning/KernelTuningOpenCl.cpp", "Tutorials/03KernelTuning/OpenClKernel.cl"}
includedirs {"Source"}
links {"ktt"}
project "04CustomArgumentTypesOpenCl"
kind "ConsoleApp"
files {"Tutorials/04CustomArgumentTypes/CustomArgumentTypesOpenCl.cpp", "Tutorials/04CustomArgumentTypes/OpenClKernel.cl"}
includedirs {"Source"}
links {"ktt"}
project "05ComputeApiInitializerOpenCl"
kind "ConsoleApp"
files {"Tutorials/05ComputeApiInitializer/ComputeApiInitializerOpenCl.cpp", "Tutorials/05ComputeApiInitializer/OpenClKernel.cl"}
includedirs {"Source"}
links {"ktt"}
linkComputeLibraries()
project "06VectorArgumentCustomizationOpenCl"
kind "ConsoleApp"
files {"Tutorials/06VectorArgumentCustomization/VectorArgumentCustomizationOpenCl.cpp", "Tutorials/06VectorArgumentCustomization/OpenClKernel.cl"}
includedirs {"Source"}
links {"ktt"}
end -- openClProjects
if cudaProjects then
project "01InfoCuda"
kind "ConsoleApp"
files {"Tutorials/01ComputeApiInfo/ComputeApiInfoCuda.cpp"}
includedirs {"Source"}
links {"ktt"}
project "02KernelRunningCuda"
kind "ConsoleApp"
files {"Tutorials/02KernelRunning/KernelRunningCuda.cpp", "Tutorials/02KernelRunning/CudaKernel.cu"}
includedirs {"Source"}
links {"ktt"}
project "03KernelTuningCuda"
kind "ConsoleApp"
files {"Tutorials/03KernelTuning/KernelTuningCuda.cpp", "Tutorials/03KernelTuning/CudaKernel.cu"}
includedirs {"Source"}
links {"ktt"}
project "04CustomArgumentTypesCuda"
kind "ConsoleApp"
files {"Tutorials/04CustomArgumentTypes/CustomArgumentTypesCuda.cpp", "Tutorials/04CustomArgumentTypes/CudaKernel.cu"}
includedirs {"Source"}
links {"ktt"}
project "05ComputeApiInitializerCuda"
kind "ConsoleApp"
files {"Tutorials/05ComputeApiInitializer/ComputeApiInitializerCuda.cpp", "Tutorials/05ComputeApiInitializer/CudaKernel.cu"}
includedirs {"Source"}
links {"ktt"}
linkComputeLibraries()
project "06VectorArgumentCustomizationCuda"
kind "ConsoleApp"
files {"Tutorials/06VectorArgumentCustomization/VectorArgumentCustomizationCuda.cpp", "Tutorials/06VectorArgumentCustomization/CudaKernel.cu"}
includedirs {"Source"}
links {"ktt"}
end -- cudaProjects
if vulkanProjects then
project "01InfoVulkan"
kind "ConsoleApp"
files {"Tutorials/01ComputeApiInfo/ComputeApiInfoVulkan.cpp"}
includedirs {"Source"}
links {"ktt"}
project "02KernelRunningVulkan"
kind "ConsoleApp"
files {"Tutorials/02KernelRunning/KernelRunningVulkan.cpp", "Tutorials/02KernelRunning/VulkanKernel.glsl"}
includedirs {"Source"}
links {"ktt"}
project "03KernelTuningVulkan"
kind "ConsoleApp"
files {"Tutorials/03KernelTuning/KernelTuningVulkan.cpp", "Tutorials/03KernelTuning/VulkanKernel.glsl"}
includedirs {"Source"}
links {"ktt"}
end -- vulkanProjects
end -- _OPTIONS["no-tutorials"]
-- Examples configuration
if not _OPTIONS["no-examples"] then
if openClProjects then
project "AtfSamplesOpenCl"
kind "ConsoleApp"
files {"Examples/AtfSamples/*.cpp", "Examples/AtfSamples/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "BicgOpenCl"
kind "ConsoleApp"
files {"Examples/Bicg/*.cpp", "Examples/Bicg/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "ClTuneConvolutionOpenCl"
kind "ConsoleApp"
files {"Examples/ClTuneConvolution/*.cpp", "Examples/ClTuneConvolution/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "ClTuneGemmOpenCl"
kind "ConsoleApp"
files {"Examples/ClTuneGemm/*.cpp", "Examples/ClTuneGemm/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "Convolution3dOpenCl"
kind "ConsoleApp"
files {"Examples/Convolution3d/*.cpp", "Examples/Convolution3d/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "CoulombSum2dOpenCl"
kind "ConsoleApp"
files {"Examples/CoulombSum2d/*.cpp", "Examples/CoulombSum2d/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "CoulombSum3dOpenCl"
kind "ConsoleApp"
files {"Examples/CoulombSum3d/*.cpp", "Examples/CoulombSum3d/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
enableOpenMP()
project "CoulombSum3dIterativeOpenCl"
kind "ConsoleApp"
files {"Examples/CoulombSum3dIterative/*.cpp", "Examples/CoulombSum3dIterative/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "CovarianceOpenCl"
kind "ConsoleApp"
files {"Examples/Covariance/*.cpp", "Examples/Covariance/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "NbodyOpenCl"
kind "ConsoleApp"
files {"Examples/Nbody/*.cpp", "Examples/Nbody/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "ReductionOpenCl"
kind "ConsoleApp"
files {"Examples/Reduction/*.cpp", "Examples/Reduction/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "SortOpenCl"
kind "ConsoleApp"
files {"Examples/Sort/*.cpp", "Examples/Sort/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "Sort2OpenCl"
kind "ConsoleApp"
files {"Examples/Sort2/*.cpp", "Examples/Sort2/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "TransposeOpenCl"
kind "ConsoleApp"
files {"Examples/Transpose/*.cpp", "Examples/Transpose/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
project "DummyOpenCl"
kind "ConsoleApp"
files {"Examples/Dummy/*.cpp", "Examples/Dummy/*.cl"}
includedirs {"Source"}
defines {"KTT_OPENCL_EXAMPLE"}
links {"ktt"}
end -- openClProjects
if cudaProjects then
project "AtfSamplesCuda"
kind "ConsoleApp"
files {"Examples/AtfSamples/*.cpp", "Examples/AtfSamples/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "BicgCuda"
kind "ConsoleApp"
files {"Examples/Bicg/*.cpp", "Examples/Bicg/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "ClTuneConvolutionCuda"
kind "ConsoleApp"
files {"Examples/ClTuneConvolution/*.cpp", "Examples/ClTuneConvolution/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "ClTuneGemmCuda"
kind "ConsoleApp"
files {"Examples/ClTuneGemm/*.cpp", "Examples/ClTuneGemm/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "CoulombSum3dCuda"
kind "ConsoleApp"
files {"Examples/CoulombSum3d/*.cpp", "Examples/CoulombSum3d/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
enableOpenMP()
project "NbodyCuda"
kind "ConsoleApp"
files {"Examples/Nbody/*.cpp", "Examples/Nbody/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "ReductionCuda"
kind "ConsoleApp"
files {"Examples/Reduction/*.cpp", "Examples/Reduction/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "SortCuda"
kind "ConsoleApp"
files {"Examples/Sort/*.cpp", "Examples/Sort/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "Sort2Cuda"
kind "ConsoleApp"
files {"Examples/Sort2/*.cpp", "Examples/Sort2/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "TransposeCuda"
kind "ConsoleApp"
files {"Examples/Transpose/*.cpp", "Examples/Transpose/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "KernelTunerConvolutionCuda"
kind "ConsoleApp"
files {"Examples/KernelTunerConvolution/*.cpp", "Examples/KernelTunerConvolution/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "KernelTunerPnpolyCuda"
kind "ConsoleApp"
files {"Examples/KernelTunerPnpoly/*.cpp", "Examples/KernelTunerPnpoly/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "DummyCuda"
kind "ConsoleApp"
files {"Examples/Dummy/*.cpp", "Examples/Dummy/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
project "MicrobenchmarksCuda"
kind "ConsoleApp"
files {"Examples/Microbenchmarks/*.cpp", "Examples/Microbenchmarks/*.cu"}
includedirs {"Source"}
defines {"KTT_CUDA_EXAMPLE"}
links {"ktt"}
end -- cudaProjects
if cppProjects then
project "CppSimple"
kind "ConsoleApp"
files {"Examples/CppSimple/CppSimple.cpp"}
includedirs {"Source"}
defines {"KTT_CPP_EXAMPLE"}
links {"ktt"}
project "CppSimpleZeroCopy"
kind "ConsoleApp"
files {"Examples/CppSimple/CppSimpleZeroCopy.cpp"}
includedirs {"Source"}
defines {"KTT_CPP_EXAMPLE"}
links {"ktt"}
project "CppTranspose"
kind "ConsoleApp"
files {"Examples/CppTranspose/*.cpp"}
includedirs {"Source"}
defines {"KTT_CPP_EXAMPLE"}
links {"ktt"}
project "CoulombSum3dCpp"
kind "ConsoleApp"
files {"Examples/CoulombSum3d/*.cpp", "Examples/CoulombSum3d/*.cppkernel"}
includedirs {"Source"}
defines {"KTT_CPP_EXAMPLE"}
links {"ktt"}
enableOpenMP()
end -- cppProjects
end -- _OPTIONS["no-examples"]
-- Unit tests configuration
if _OPTIONS["tests"] then
project "Tests"
kind "ConsoleApp"
files
{
"Tests/**",
"Source/**",
"Libraries/Catch-2.13.8/**",
"Libraries/CTPL-Ahajha/**",
"Libraries/date-3/**",
"Libraries/Json-3.9.1/**",
"Libraries/pugixml-1.11.4/**"
}
includedirs
{
"Source",
"Libraries/Catch-2.13.8",
"Libraries/CTPL-Ahajha",
"Libraries/date-3",
"Libraries/Json-3.9.1",
"Libraries/pugixml-1.11.4"
}
if _OPTIONS["no-opencl"] then
removefiles {"Tests/OpenClEngineTests.cpp", "Tests/Kernels/SimpleOpenClKernel.cl"}
end
filter "action:gmake*"
buildoptions {"-pthread"}
linkoptions {"-pthread"}
filter {}
defines {"KTT_LIBRARY", "KTT_TESTS"}
linkAllLibraries()
end -- _OPTIONS["tests"]