-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinding.gyp
115 lines (94 loc) · 2.79 KB
/
binding.gyp
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
{
## for windows, be sure to do node-gyp rebuild -msvs_version=2013,
## and run under a msvs shell
## for all targets
'conditions': [
[ 'OS=="win"', {'variables': {'obj': 'obj'}},
{'variables': {'obj': 'o'}}]],
"targets": [
{
"target_name": "cuno",
"sources": [
"./src/logger/methods/deviceArray.cu",
"./src/logger/methods/deviceMatrix.cu",
"./src/logger/methods/hostArray.cpp",
"./src/logger/methods/hostMatrix.cpp",
"./src/v8/methods/FromNativeModel.cpp",
"./src/v8/methods/getSingleCallArgs.cpp",
"./src/Types/MethodInput/MethodInput.cu",
"./src/error/errors.cu",
"./src/Types/GPUDann/allocate.cu",
"./src/Types/GPUDann/toDevice.cu",
"./src/main.cu",
"./src/kernels/reset.cu",
"./src/kernels/sigmoid.cu",
"./src/wrappers/sigmoid_wrap.cu",
"./src/kernels/add.cu",
"./src/wrappers/add_wrap.cu",
"./src/kernels/dot.cu",
"./src/wrappers/dot_wrap.cu",
"./src/kernels/matVecDot.cu",
"./src/wrappers/matvec_wrap.cu",
"./src/bindings/node_matvec.cu",
"./src/kernels/layerConv.cu",
"./src/wrappers/layer_wrap.cu",
"./src/wrappers/ffw.cu",
"./src/bindings/node_ffw.cu"
],
'rules': [{
'extension': 'cu',
'inputs': ['<(RULE_INPUT_PATH)'],
'outputs':[ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).<(obj)'],
'conditions': [
[ 'OS=="win"',
{'rule_name': 'cuda on windows',
'message': "compile cuda file on windows",
'process_outputs_as_sources': 0,
'action': ['nvcc -c <(_inputs) -o <(_outputs)'],
},
{'rule_name': 'cuda on linux',
'message': "compile cuda file on linux",
'process_outputs_as_sources': 1,
'action': ['nvcc','-Xcompiler','-fpic','-c',
'<@(_inputs)','-o','<@(_outputs)','-arch=sm_60'],
}]]}],
'conditions': [
[ 'OS=="mac"', {
'libraries': ['-framework CUDA'],
'include_dirs': ['/usr/local/include'],
'library_dirs': ['/usr/local/lib'],
}],
[ 'OS=="linux"', {
'libraries': ['-lcuda', '-lcudart'],
'include_dirs': ['/usr/local/include', '/opt/cuda/include'],
'library_dirs': ['/usr/local/lib', '/opt/cuda/lib64','/usr/local/cuda/lib64'],
}],
[ 'OS=="win"', {
'conditions': [
['target_arch=="x64"',
{
'variables': { 'arch': 'x64' }
}, {
'variables': { 'arch': 'Win32' }
}
],
],
'variables': {
'cuda_root%': '$(CUDA_PATH)'
},
'libraries': [
'-l<(cuda_root)/lib/<(arch)/cuda.lib',
'-l<(cuda_root)/lib/<(arch)/cudart.lib',
],
"include_dirs": [
"<(cuda_root)/include",
],
}, {
"include_dirs": [
"/usr/local/cuda/include"
],
}]
]
}
]
}