Skip to content

Commit

Permalink
fix device info arguments, comment out integer functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cdeterman committed May 20, 2016
1 parent 133467f commit f3d07d5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 46 deletions.
5 changes: 2 additions & 3 deletions R/wrappers-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,10 @@ deviceHasDouble <- function(platform_idx=1L, gpu_idx=1L){

device_type <- currentDevice()$device_type


out <- switch(device_type,
"gpu" = gpuInfo(platform_index = as.integer(platform_idx),
"gpu" = gpuInfo(platform_idx = as.integer(platform_idx),
device_idx = as.integer(gpu_idx))$double_support,
"cpu" = cpuInfo(platform_index = as.integer(platform_idx),
"cpu" = cpuInfo(platform_idx = as.integer(platform_idx),
device_idx = as.integer(gpu_idx))$double_support,
stop("Unrecognized device type")
)
Expand Down
10 changes: 5 additions & 5 deletions R/wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ gpu_Mat_mult <- function(A, B){
switch(type,
integer = {
stop("integer not currently implemented")
cpp_gpuMatrix_igemm(A@address,
B@address,
C@address,
kernel,
device_flag)
# cpp_gpuMatrix_igemm(A@address,
# B@address,
# C@address,
# kernel,
# device_flag)
# cpp_vienna_gpuMatrix_igemm(A@address,
# B@address,
# C@address)
Expand Down
76 changes: 38 additions & 38 deletions tests/testthat/test_gpuVector_algebra.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,44 @@ test_that("gpuVector comparison operator", {
info = "gpuVector/vector == operator not working correctly")
})

test_that("gpuVector integer additon", {

has_gpu_skip()

gpuA <- gpuVector(Aint)
gpuB <- gpuVector(Bint)

# R default
C <- Aint + Bint

# manual call
#gpuC <- gpu_vec_add(A, B)

# generic call
gpuC <- gpuA + gpuB

expect_equivalent(gpuC[], C)
expect_is(gpuC, "gpuVector", "inherits from gpuVector")
expect_is(gpuC, "igpuVector", "is a igpuVector object")
})

test_that("gpuVector integer subtraction", {

has_gpu_skip()

gpuA <- gpuVector(Aint)
gpuB <- gpuVector(Bint)

# R default
C <- Aint - Bint

# generic call
gpuC <- gpuA - gpuB

expect_equivalent(gpuC[], C)
expect_is(gpuC, "gpuVector", "following vector subtraction")
expect_is(gpuC, "igpuVector", "following vector subtraction")
})
# test_that("gpuVector integer additon", {
#
# has_gpu_skip()
#
# gpuA <- gpuVector(Aint)
# gpuB <- gpuVector(Bint)
#
# # R default
# C <- Aint + Bint
#
# # manual call
# #gpuC <- gpu_vec_add(A, B)
#
# # generic call
# gpuC <- gpuA + gpuB
#
# expect_equivalent(gpuC[], C)
# expect_is(gpuC, "gpuVector", "inherits from gpuVector")
# expect_is(gpuC, "igpuVector", "is a igpuVector object")
# })
#
# test_that("gpuVector integer subtraction", {
#
# has_gpu_skip()
#
# gpuA <- gpuVector(Aint)
# gpuB <- gpuVector(Bint)
#
# # R default
# C <- Aint - Bint
#
# # generic call
# gpuC <- gpuA - gpuB
#
# expect_equivalent(gpuC[], C)
# expect_is(gpuC, "gpuVector", "following vector subtraction")
# expect_is(gpuC, "igpuVector", "following vector subtraction")
# })

# Single Precision Tests

Expand Down

0 comments on commit f3d07d5

Please sign in to comment.