-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD.bazel
74 lines (66 loc) · 2.41 KB
/
BUILD.bazel
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
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_cuda//cuda:defs.bzl", "cuda_library")
package(
default_visibility = ["//visibility:public"],
)
cc_library(
name = "wamca_cc",
srcs = ["source/log.cpp",
"source/except.cpp",
"source/mtrand.cpp",
"source/tsplib.cpp",
"source/utils.cpp",
],
hdrs = ["source/log.h",
"source/except.h",
"source/mtrand.h",
"source/tsplib.h",
"source/utils.h",
"source/types.h",
"source/graph.hpp",
"source/thirdparty/UnpackTuple.hpp",
"source/consts.h",
],
)
cuda_library(
name = "wamca_cuda",
copts = ["-std=c++17", "-Xptxas", "-v", "-D_FORCE_INLINES", "-DLOG_LEVEL=1", "-DGPU_PROFILE"], # "-gencode arch=compute_53,code=sm_53"],
srcs = ["source/mlk2opt.cu",
"source/mlkswap.cu",
"source/mlkoropt.cu",
"source/mlkernel.cu",
"source/mlsolution.cpp", # SHOULD BE .cu
"source/mlads.cpp",
"source/mlproblem.cpp",
],
hdrs = ["source/mlk2opt.h",
"source/gpu.h", # SHOULD BE .cuh
"source/cuda/gpu_helper.h",
"source/cuda/gpu_string.h",
"source/mlkernel.h",
"source/WamcaExperiment.hpp",
"source/mlads.h",
"source/mlsolution.h",
"source/mlproblem.h",
"source/mlkswap.h",
"source/mlkoropt.h",
],
deps = [":wamca_cc"]
)
cc_binary(
name = "main_wamca",
srcs = ["source/main.cpp"],
deps = [":wamca_cuda"],
)
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
# bazel run :refresh_compile_commands
refresh_compile_commands(
name = "refresh_compile_commands",
#targets = {
# FOR WINDOWS /MT:
# ???
# FOR LINUX:
#"//:app_demo": "--cxxopt=-std=c++20 --define=MY_LONG_SIZE=64 --define=GMP_TYPE_L=\"#define GMP_DEMANDS_UINTD_LONG\" --define=GMP_TYPE_LL=\"/* #undef GMP_DEMANDS_UINTD_LONG_LONG */\" --define=TIME_UNIX_WIN=\"#define HAVE_GETTIMEOFDAY\" ",
#"//tests:Evaluator_test": "--cxxopt=-std=c++20 --define=MY_LONG_SIZE=64 --define=GMP_TYPE_L=\"#define GMP_DEMANDS_UINTD_LONG\" --define=GMP_TYPE_LL=\"/* #undef GMP_DEMANDS_UINTD_LONG_LONG */\" --define=TIME_UNIX_WIN=\"#define HAVE_GETTIMEOFDAY\" ",
#},
)