-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRcppExports.R
More file actions
108 lines (97 loc) · 2.46 KB
/
Copy pathRcppExports.R
File metadata and controls
108 lines (97 loc) · 2.46 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
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
gpu_initialize <- function(type = "opencl", print_info = TRUE) {
invisible(.Call(`_RcppBandicoot_gpu_initialize`, type, print_info))
}
#' Get Bandicoot version
#'
#' Prints the current version of the Bandicoot library.
#' @export
#' @examples
#' bandicoot_version()
bandicoot_version <- function() {
invisible(.Call(`_RcppBandicoot_bandicoot_version`))
}
#' GPU Matrix Multiplication
#'
#' Multiply two matrices on the GPU using Bandicoot
#'
#' @param A First matrix
#' @param B Second matrix
#' @return Product of A and B computed on GPU
#' @export
gpu_matrix_multiply <- function(A, B) {
.Call(`_RcppBandicoot_gpu_matrix_multiply`, A, B)
}
#' GPU Matrix Transpose
#'
#' Transpose a matrix on the GPU using Bandicoot
#'
#' @param A Matrix to transpose
#' @return Transposed matrix computed on GPU
#' @export
gpu_transpose <- function(A) {
.Call(`_RcppBandicoot_gpu_transpose`, A)
}
#' GPU Matrix Addition
#'
#' Add two matrices on the GPU using Bandicoot
#'
#' @param A First matrix
#' @param B Second matrix
#' @return Sum of A and B computed on GPU
#' @export
gpu_matrix_add <- function(A, B) {
.Call(`_RcppBandicoot_gpu_matrix_add`, A, B)
}
#' GPU Element-wise Operations
#'
#' Apply element-wise square operation on GPU
#'
#' @param A Input matrix
#' @return Matrix with each element squared, computed on GPU
#' @export
gpu_element_square <- function(A) {
.Call(`_RcppBandicoot_gpu_element_square`, A)
}
#' GPU Sum
#'
#' Calculate the sum of all elements in a matrix on GPU
#'
#' @param A Input matrix
#' @return Sum of all elements
#' @export
gpu_sum <- function(A) {
.Call(`_RcppBandicoot_gpu_sum`, A)
}
#' GPU Mean
#'
#' Calculate the mean of all elements in a matrix on GPU
#'
#' @param A Input matrix
#' @return Mean of all elements
#' @export
gpu_mean <- function(A) {
.Call(`_RcppBandicoot_gpu_mean`, A)
}
#' Create Identity Matrix on GPU
#'
#' Create an identity matrix on the GPU
#'
#' @param n Size of the identity matrix
#' @return n x n identity matrix on GPU
#' @export
gpu_eye <- function(n) {
.Call(`_RcppBandicoot_gpu_eye`, n)
}
#' Create Random Matrix on GPU
#'
#' Create a matrix with random values on the GPU
#'
#' @param n_rows Number of rows
#' @param n_cols Number of columns
#' @return Random matrix on GPU
#' @export
gpu_randu <- function(n_rows, n_cols) {
.Call(`_RcppBandicoot_gpu_randu`, n_rows, n_cols)
}