Skip to content

Commit 4e15b30

Browse files
committed
update non-GPU Makevars
1 parent 3549a9d commit 4e15b30

File tree

3 files changed

+84
-2
lines changed

3 files changed

+84
-2
lines changed

src/MakevarsCPU.in

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
## Use the R_HOME indirection to support installations of multiple R version
2+
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
3+
4+
## As an alternative, one can also add this code in a file 'configure'
5+
##
6+
## PKG_LIBS=`${R_HOME}/bin/Rscript -e "Rcpp:::LdFlags()"`
7+
##
8+
## sed -e "s|@PKG_LIBS@|${PKG_LIBS}|" \
9+
## src/Makevars.in > src/Makevars
10+
##
11+
## which together with the following file 'src/Makevars.in'
12+
##
13+
## PKG_LIBS = @PKG_LIBS@
14+
##
15+
## can be used to create src/Makevars dynamically. This scheme is more
16+
## powerful and can be expanded to also check for and link with other
17+
## libraries. It should be complemented by a file 'cleanup'
18+
##
19+
## rm src/Makevars
20+
##
21+
## which removes the autogenerated file src/Makevars.
22+
##
23+
## Of course, autoconf can also be used to write configure files. This is
24+
## done by a number of packages, but recommended only for more advanced users
25+
## comfortable with autoconf and its related tools.
26+
27+
PKG_CPPFLAGS = -I. -Icyclops -DR_BUILD -DDOUBLE_PRECISION
28+
PKG_CXXFLAGS = -g1
29+
30+
OBJECTS.cyclops = \
31+
cyclops/CcdInterface.o \
32+
cyclops/CompressedDataMatrix.o \
33+
cyclops/CyclicCoordinateDescent.o \
34+
cyclops/ModelData.o \
35+
cyclops/Timer.o
36+
37+
OBJECTS.drivers = \
38+
cyclops/drivers/AbstractCrossValidationDriver.o \
39+
cyclops/drivers/AbstractDriver.o \
40+
cyclops/drivers/AbstractSelector.o \
41+
cyclops/drivers/AutoSearchCrossValidationDriver.o \
42+
cyclops/drivers/BootstrapDriver.o \
43+
cyclops/drivers/BootstrapSelector.o \
44+
cyclops/drivers/CrossValidationSelector.o \
45+
cyclops/drivers/WeightBasedSelector.o \
46+
cyclops/drivers/GridSearchCrossValidationDriver.o \
47+
cyclops/drivers/HierarchyAutoSearchCrossValidationDriver.o \
48+
cyclops/drivers/HierarchyGridSearchCrossValidationDriver.o \
49+
cyclops/drivers/ProportionSelector.o
50+
51+
OBJECTS.priors = \
52+
cyclops/priors/CovariatePrior.o
53+
54+
OBJECTS.io = \
55+
cyclops/io/InputReader.o
56+
57+
OBJECTS.engine = \
58+
cyclops/engine/AbstractModelSpecifics.o
59+
60+
OBJECTS.utils = \
61+
utils/HParSearch.o
62+
63+
OBJECTS.thread = \
64+
tinythread/tinythread.o
65+
66+
OBJECTS.R = \
67+
IsSorted.o \
68+
RcppExports.o \
69+
RcppModelData.o \
70+
RcppCyclopsInterface.o \
71+
RcppGpuInterface.o \
72+
RcppIsSorted.o
73+
74+
OBJECTS = $(OBJECTS.cyclops) $(OBJECTS.drivers) \
75+
$(OBJECTS.engine) $(OBJECTS.utils) \
76+
$(OBJECTS.threads) $(OBJECTS.R) \
77+
$(OBJECTS.priors) $(OBJECTS.io)

tests/testthat/test-gpucox.R

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ library("testthat")
33
library("survival")
44

55

6-
GpuDevice <- listOpenCLDevices()[1] # "TITAN V"
7-
# GpuDevice <- listOpenCLDevices()[2] # "GeForce RTX 2080"
6+
GpuDevice <- listOpenCLDevices()[1]
87
tolerance <- 1E-4
98

109

1110
# small cox
1211
test_that("Check small Cox on GPU", {
12+
skip_if(length(listOpenCLDevices()) == 0, "GPU not available")
1313
test <- read.table(header=T, sep = ",", text = "
1414
start, length, event, x1, x2
1515
0, 4, 1,0,0
@@ -34,6 +34,7 @@ test_that("Check small Cox on GPU", {
3434
})
3535

3636
test_that("Check very small Cox example with time-ties", {
37+
skip_if(length(listOpenCLDevices()) == 0, "GPU not available")
3738
test <- read.table(header=T, sep = ",", text = "
3839
start, length, event, x1, x2
3940
0, 4, 1,0,0
@@ -59,6 +60,7 @@ start, length, event, x1, x2
5960

6061
# large cox
6162
test_that("Check Cox on GPU", {
63+
skip_if(length(listOpenCLDevices()) == 0, "GPU not available")
6264
set.seed(123)
6365
sim <- simulateCyclopsData(nstrata = 1,
6466
nrows = 100000,
@@ -83,6 +85,7 @@ test_that("Check Cox on GPU", {
8385

8486
# lasso cv
8587
test_that("Check cross-validation for lasso Cox on GPU", {
88+
skip_if(length(listOpenCLDevices()) == 0, "GPU not available")
8689
set.seed(123)
8790
sim <- simulateCyclopsData(nstrata = 1,
8891
nrows = 900,
@@ -112,6 +115,7 @@ test_that("Check cross-validation for lasso Cox on GPU", {
112115

113116
# multi-core
114117
test_that("Check multi-core cross-validation for lasso Cox on GPU", {
118+
skip_if(length(listOpenCLDevices()) == 0, "GPU not available")
115119
set.seed(123)
116120
sim <- simulateCyclopsData(nstrata = 1,
117121
nrows = 900,

tests/testthat/test-timevaryingCox.R

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ GpuDevice <- listOpenCLDevices()[1]
55
tolerance <- 1E-4
66

77
test_that("Check very small Cox example with time-varying coefficient as stratified model", {
8+
skip_if(length(listOpenCLDevices()) == 0, "GPU not available")
89
test <- read.table(header=T, sep = ",", text = "
910
start, length, event, x1, x2
1011
0, 4, 1,0,0

0 commit comments

Comments
 (0)