scm2cpp-learn 0.18.0__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scm2cpp_learn/__init__.py +3836 -0
- scm2cpp_learn/_classifiers.cp312-win_amd64.pyd +0 -0
- scm2cpp_learn/_compat.py +284 -0
- scm2cpp_learn/_generated/__init__.py +0 -0
- scm2cpp_learn/_generated/_loader.py +41 -0
- scm2cpp_learn/_generated/_loader_accel_cublas.py +173 -0
- scm2cpp_learn/_generated/_loader_classifiers.py +308 -0
- scm2cpp_learn/_generated/_loader_derived_blas.py +29 -0
- scm2cpp_learn/_generated/_loader_derived_cublas.py +29 -0
- scm2cpp_learn/_generated/_loader_derived_loops.py +29 -0
- scm2cpp_learn/_generated/_loader_gpu_cuda.py +313 -0
- scm2cpp_learn/_generated/_loader_gramops_blas.py +692 -0
- scm2cpp_learn/_generated/_loader_gramops_loops.py +711 -0
- scm2cpp_learn/_generated/_loader_nmf_blas.py +29 -0
- scm2cpp_learn/_generated/_loader_nmf_cublas.py +29 -0
- scm2cpp_learn/_generated/_loader_nmf_loops.py +29 -0
- scm2cpp_learn/_generated/accel_cublas/accel.cpp +24 -0
- scm2cpp_learn/_generated/accel_cublas/accel.hpp +1178 -0
- scm2cpp_learn/_generated/accel_cublas/accel_capi.cpp +76 -0
- scm2cpp_learn/_generated/classifiers.cpp +37 -0
- scm2cpp_learn/_generated/classifiers.hpp +3745 -0
- scm2cpp_learn/_generated/classifiers_capi.cpp +115 -0
- scm2cpp_learn/_generated/derived_blas/lasso_design.cpp +5 -0
- scm2cpp_learn/_generated/derived_blas/lasso_design.hpp +156 -0
- scm2cpp_learn/_generated/derived_blas/lasso_design_capi.cpp +19 -0
- scm2cpp_learn/_generated/derived_cublas/lasso_design.cpp +5 -0
- scm2cpp_learn/_generated/derived_cublas/lasso_design.hpp +158 -0
- scm2cpp_learn/_generated/derived_cublas/lasso_design_capi.cpp +19 -0
- scm2cpp_learn/_generated/derived_loops/lasso_design.cpp +5 -0
- scm2cpp_learn/_generated/derived_loops/lasso_design.hpp +179 -0
- scm2cpp_learn/_generated/derived_loops/lasso_design_capi.cpp +19 -0
- scm2cpp_learn/_generated/gpu_cuda/gpu.cpp +37 -0
- scm2cpp_learn/_generated/gpu_cuda/gpu.hpp +3846 -0
- scm2cpp_learn/_generated/gpu_cuda/gpu_capi.cpp +308 -0
- scm2cpp_learn/_generated/gramops_blas/gramops.cpp +82 -0
- scm2cpp_learn/_generated/gramops_blas/gramops.hpp +5411 -0
- scm2cpp_learn/_generated/gramops_blas/gramops_capi.cpp +244 -0
- scm2cpp_learn/_generated/gramops_loops/gramops.cpp +82 -0
- scm2cpp_learn/_generated/gramops_loops/gramops.hpp +6395 -0
- scm2cpp_learn/_generated/gramops_loops/gramops_capi.cpp +250 -0
- scm2cpp_learn/_generated/lasso_cov.cpp +7 -0
- scm2cpp_learn/_generated/lasso_cov.hpp +152 -0
- scm2cpp_learn/_generated/lasso_cov_capi.cpp +25 -0
- scm2cpp_learn/_generated/nmf_blas/nmf_cd.cpp +5 -0
- scm2cpp_learn/_generated/nmf_blas/nmf_cd.hpp +132 -0
- scm2cpp_learn/_generated/nmf_blas/nmf_cd_capi.cpp +19 -0
- scm2cpp_learn/_generated/nmf_cublas/nmf_cd.cpp +5 -0
- scm2cpp_learn/_generated/nmf_cublas/nmf_cd.hpp +136 -0
- scm2cpp_learn/_generated/nmf_cublas/nmf_cd_capi.cpp +19 -0
- scm2cpp_learn/_generated/nmf_loops/nmf_cd.cpp +5 -0
- scm2cpp_learn/_generated/nmf_loops/nmf_cd.hpp +167 -0
- scm2cpp_learn/_generated/nmf_loops/nmf_cd_capi.cpp +19 -0
- scm2cpp_learn/_generated/scm2cpp-blas.hpp +158 -0
- scm2cpp_learn/_generated/scm2cpp-cublas.hpp +155 -0
- scm2cpp_learn/_generated/scm2cpp-cuda.hpp +285 -0
- scm2cpp_learn/_generated/scm2cpp.hpp +1627 -0
- scm2cpp_learn/_gramops_blas.cp312-win_amd64.pyd +0 -0
- scm2cpp_learn/_lasso_cov.cp312-win_amd64.pyd +0 -0
- scm2cpp_learn/_lasso_derived_blas.cp312-win_amd64.pyd +0 -0
- scm2cpp_learn/_libfind.py +153 -0
- scm2cpp_learn/_nmf_blas.cp312-win_amd64.pyd +0 -0
- scm2cpp_learn/batch_capi.cu +428 -0
- scm2cpp_learn-0.18.0.dist-info/DELVEWHEEL +2 -0
- scm2cpp_learn-0.18.0.dist-info/METADATA +1171 -0
- scm2cpp_learn-0.18.0.dist-info/RECORD +72 -0
- scm2cpp_learn-0.18.0.dist-info/WHEEL +5 -0
- scm2cpp_learn-0.18.0.dist-info/top_level.txt +1 -0
- scm2cpp_learn.libs/.load-order-scm2cpp_learn-0.18.0 +4 -0
- scm2cpp_learn.libs/libopenblas-0486735c359a67419d8832e3c40e2837.dll +4 -0
- scm2cpp_learn.libs/msvcp140-73438573e87f9a2fd944b01def13566d.dll +0 -0
- scm2cpp_learn.libs/vcruntime140-052ad6a20d375957e82aa6a3c441ea54.dll +0 -0
- scm2cpp_learn.libs/vcruntime140_1-a198370e11c6e7469d1cf0ef5b3f433d.dll +0 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
// extern "C" wrappers over the translated functions, for Python and
|
|
2
|
+
// any other caller that speaks the C ABI. Array parameters arrive as
|
|
3
|
+
// element pointers: a view parameter takes the pointer as it is, so
|
|
4
|
+
// the caller's buffer is read and written in place with no copy; a
|
|
5
|
+
// fixed-extent one is reinterpreted as the std::array the function
|
|
6
|
+
// expects. The caller guarantees the length either way.
|
|
7
|
+
// Build (boost includes only if the generated header asks for them,
|
|
8
|
+
// which a numeric kernel's does not):
|
|
9
|
+
// g++ -O2 -std=c++17 -shared -fPIC -I. -o libgpu.so gpu_capi.cpp
|
|
10
|
+
#include "gpu.hpp"
|
|
11
|
+
#include <vector>
|
|
12
|
+
#include <algorithm>
|
|
13
|
+
|
|
14
|
+
extern "C" double scm2cpp_eig_hypot(double a, double b) {
|
|
15
|
+
double scm2cpp_r = eig_hypot(a, b);
|
|
16
|
+
scm2cpp::cu::end_call();
|
|
17
|
+
return scm2cpp_r;
|
|
18
|
+
}
|
|
19
|
+
extern "C" int scm2cpp_sym_eigen(double* a, int a_len, double* v, int v_len, double* ev, int ev_len, double* e, int e_len, int m) {
|
|
20
|
+
int scm2cpp_r = sym_eigen(scm2cpp::span<double>(a, a_len), scm2cpp::span<double>(v, v_len), scm2cpp::span<double>(ev, ev_len), scm2cpp::span<double>(e, e_len), m);
|
|
21
|
+
{ scm2cpp::span<double> s(a, a_len); scm2cpp::cu::need_host(s); }
|
|
22
|
+
{ scm2cpp::span<double> s(v, v_len); scm2cpp::cu::need_host(s); }
|
|
23
|
+
{ scm2cpp::span<double> s(ev, ev_len); scm2cpp::cu::need_host(s); }
|
|
24
|
+
{ scm2cpp::span<double> s(e, e_len); scm2cpp::cu::need_host(s); }
|
|
25
|
+
scm2cpp::cu::end_call();
|
|
26
|
+
return scm2cpp_r;
|
|
27
|
+
}
|
|
28
|
+
extern "C" double scm2cpp_eig_abs(double a) {
|
|
29
|
+
double scm2cpp_r = eig_abs(a);
|
|
30
|
+
scm2cpp::cu::end_call();
|
|
31
|
+
return scm2cpp_r;
|
|
32
|
+
}
|
|
33
|
+
extern "C" int scm2cpp_eig_order(double* ev, int ev_len, int* ord, int ord_len, int m) {
|
|
34
|
+
int scm2cpp_r = eig_order(scm2cpp::span<double>(ev, ev_len), scm2cpp::span<int>(ord, ord_len), m);
|
|
35
|
+
{ scm2cpp::span<double> s(ev, ev_len); scm2cpp::cu::need_host(s); }
|
|
36
|
+
{ scm2cpp::span<int> s(ord, ord_len); scm2cpp::cu::need_host(s); }
|
|
37
|
+
scm2cpp::cu::end_call();
|
|
38
|
+
return scm2cpp_r;
|
|
39
|
+
}
|
|
40
|
+
extern "C" int scm2cpp_sym_eigen_top(double* a, int a_len, double* v, int v_len, double* ev, int ev_len, double* e, int e_len, int m, int k) {
|
|
41
|
+
int scm2cpp_r = sym_eigen_top(scm2cpp::span<double>(a, a_len), scm2cpp::span<double>(v, v_len), scm2cpp::span<double>(ev, ev_len), scm2cpp::span<double>(e, e_len), m, k);
|
|
42
|
+
{ scm2cpp::span<double> s(a, a_len); scm2cpp::cu::need_host(s); }
|
|
43
|
+
{ scm2cpp::span<double> s(v, v_len); scm2cpp::cu::need_host(s); }
|
|
44
|
+
{ scm2cpp::span<double> s(ev, ev_len); scm2cpp::cu::need_host(s); }
|
|
45
|
+
{ scm2cpp::span<double> s(e, e_len); scm2cpp::cu::need_host(s); }
|
|
46
|
+
scm2cpp::cu::end_call();
|
|
47
|
+
return scm2cpp_r;
|
|
48
|
+
}
|
|
49
|
+
extern "C" int scm2cpp_sym_eigen_gen(double* a, int a_len, double* b, int b_len, double* v, int v_len, double* ev, int ev_len, double* e, int e_len, int m) {
|
|
50
|
+
int scm2cpp_r = sym_eigen_gen(scm2cpp::span<double>(a, a_len), scm2cpp::span<double>(b, b_len), scm2cpp::span<double>(v, v_len), scm2cpp::span<double>(ev, ev_len), scm2cpp::span<double>(e, e_len), m);
|
|
51
|
+
{ scm2cpp::span<double> s(a, a_len); scm2cpp::cu::need_host(s); }
|
|
52
|
+
{ scm2cpp::span<double> s(b, b_len); scm2cpp::cu::need_host(s); }
|
|
53
|
+
{ scm2cpp::span<double> s(v, v_len); scm2cpp::cu::need_host(s); }
|
|
54
|
+
{ scm2cpp::span<double> s(ev, ev_len); scm2cpp::cu::need_host(s); }
|
|
55
|
+
{ scm2cpp::span<double> s(e, e_len); scm2cpp::cu::need_host(s); }
|
|
56
|
+
scm2cpp::cu::end_call();
|
|
57
|
+
return scm2cpp_r;
|
|
58
|
+
}
|
|
59
|
+
extern "C" double scm2cpp_ica_tanh(double x) {
|
|
60
|
+
double scm2cpp_r = ica_tanh(x);
|
|
61
|
+
scm2cpp::cu::end_call();
|
|
62
|
+
return scm2cpp_r;
|
|
63
|
+
}
|
|
64
|
+
extern "C" int scm2cpp_ica_sym(double* w, int w_len, double* a, int a_len, double* v, int v_len, double* ev, int ev_len, double* e, int e_len, double* t, int t_len, int m) {
|
|
65
|
+
int scm2cpp_r = ica_sym(scm2cpp::span<double>(w, w_len), scm2cpp::span<double>(a, a_len), scm2cpp::span<double>(v, v_len), scm2cpp::span<double>(ev, ev_len), scm2cpp::span<double>(e, e_len), scm2cpp::span<double>(t, t_len), m);
|
|
66
|
+
{ scm2cpp::span<double> s(w, w_len); scm2cpp::cu::need_host(s); }
|
|
67
|
+
{ scm2cpp::span<double> s(a, a_len); scm2cpp::cu::need_host(s); }
|
|
68
|
+
{ scm2cpp::span<double> s(v, v_len); scm2cpp::cu::need_host(s); }
|
|
69
|
+
{ scm2cpp::span<double> s(ev, ev_len); scm2cpp::cu::need_host(s); }
|
|
70
|
+
{ scm2cpp::span<double> s(e, e_len); scm2cpp::cu::need_host(s); }
|
|
71
|
+
{ scm2cpp::span<double> s(t, t_len); scm2cpp::cu::need_host(s); }
|
|
72
|
+
scm2cpp::cu::end_call();
|
|
73
|
+
return scm2cpp_r;
|
|
74
|
+
}
|
|
75
|
+
extern "C" int scm2cpp_fastica(double* x, int x_len, double* winit, int winit_len, double* comps, int comps_len, double* white, int white_len, double* unmix, int unmix_len, double* mean, int mean_len, int maxiter, double tol, int n, int p, int nc) {
|
|
76
|
+
int scm2cpp_r = fastica(scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(winit, winit_len), scm2cpp::span<double>(comps, comps_len), scm2cpp::span<double>(white, white_len), scm2cpp::span<double>(unmix, unmix_len), scm2cpp::span<double>(mean, mean_len), maxiter, tol, n, p, nc);
|
|
77
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
78
|
+
{ scm2cpp::span<double> s(winit, winit_len); scm2cpp::cu::need_host(s); }
|
|
79
|
+
{ scm2cpp::span<double> s(comps, comps_len); scm2cpp::cu::need_host(s); }
|
|
80
|
+
{ scm2cpp::span<double> s(white, white_len); scm2cpp::cu::need_host(s); }
|
|
81
|
+
{ scm2cpp::span<double> s(unmix, unmix_len); scm2cpp::cu::need_host(s); }
|
|
82
|
+
{ scm2cpp::span<double> s(mean, mean_len); scm2cpp::cu::need_host(s); }
|
|
83
|
+
scm2cpp::cu::end_call();
|
|
84
|
+
return scm2cpp_r;
|
|
85
|
+
}
|
|
86
|
+
extern "C" int scm2cpp_gmm_mstep(double* x, int x_len, double* resp, int resp_len, double* weights, int weights_len, double* means, int means_len, double* prec, int prec_len, double* dw, int dw_len, double* cov, int cov_len, double* l, int l_len, double* u, int u_len, double reg, int norm, int n, int p, int kc) {
|
|
87
|
+
int scm2cpp_r = gmm_mstep(scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(resp, resp_len), scm2cpp::span<double>(weights, weights_len), scm2cpp::span<double>(means, means_len), scm2cpp::span<double>(prec, prec_len), scm2cpp::span<double>(dw, dw_len), scm2cpp::span<double>(cov, cov_len), scm2cpp::span<double>(l, l_len), scm2cpp::span<double>(u, u_len), reg, norm, n, p, kc);
|
|
88
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
89
|
+
{ scm2cpp::span<double> s(resp, resp_len); scm2cpp::cu::need_host(s); }
|
|
90
|
+
{ scm2cpp::span<double> s(weights, weights_len); scm2cpp::cu::need_host(s); }
|
|
91
|
+
{ scm2cpp::span<double> s(means, means_len); scm2cpp::cu::need_host(s); }
|
|
92
|
+
{ scm2cpp::span<double> s(prec, prec_len); scm2cpp::cu::need_host(s); }
|
|
93
|
+
{ scm2cpp::span<double> s(dw, dw_len); scm2cpp::cu::need_host(s); }
|
|
94
|
+
{ scm2cpp::span<double> s(cov, cov_len); scm2cpp::cu::need_host(s); }
|
|
95
|
+
{ scm2cpp::span<double> s(l, l_len); scm2cpp::cu::need_host(s); }
|
|
96
|
+
{ scm2cpp::span<double> s(u, u_len); scm2cpp::cu::need_host(s); }
|
|
97
|
+
scm2cpp::cu::end_call();
|
|
98
|
+
return scm2cpp_r;
|
|
99
|
+
}
|
|
100
|
+
extern "C" double scm2cpp_gmm_estep(double* x, int x_len, double* resp, int resp_len, double* weights, int weights_len, double* means, int means_len, double* prec, int prec_len, double* wlp, int wlp_len, double* y, int y_len, double* u, int u_len, double* mu, int mu_len, int n, int p, int kc) {
|
|
101
|
+
double scm2cpp_r = gmm_estep(scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(resp, resp_len), scm2cpp::span<double>(weights, weights_len), scm2cpp::span<double>(means, means_len), scm2cpp::span<double>(prec, prec_len), scm2cpp::span<double>(wlp, wlp_len), scm2cpp::span<double>(y, y_len), scm2cpp::span<double>(u, u_len), scm2cpp::span<double>(mu, mu_len), n, p, kc);
|
|
102
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
103
|
+
{ scm2cpp::span<double> s(resp, resp_len); scm2cpp::cu::need_host(s); }
|
|
104
|
+
{ scm2cpp::span<double> s(weights, weights_len); scm2cpp::cu::need_host(s); }
|
|
105
|
+
{ scm2cpp::span<double> s(means, means_len); scm2cpp::cu::need_host(s); }
|
|
106
|
+
{ scm2cpp::span<double> s(prec, prec_len); scm2cpp::cu::need_host(s); }
|
|
107
|
+
{ scm2cpp::span<double> s(wlp, wlp_len); scm2cpp::cu::need_host(s); }
|
|
108
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
109
|
+
{ scm2cpp::span<double> s(u, u_len); scm2cpp::cu::need_host(s); }
|
|
110
|
+
{ scm2cpp::span<double> s(mu, mu_len); scm2cpp::cu::need_host(s); }
|
|
111
|
+
scm2cpp::cu::end_call();
|
|
112
|
+
return scm2cpp_r;
|
|
113
|
+
}
|
|
114
|
+
extern "C" double scm2cpp_gmm_abs(double a) {
|
|
115
|
+
double scm2cpp_r = gmm_abs(a);
|
|
116
|
+
scm2cpp::cu::end_call();
|
|
117
|
+
return scm2cpp_r;
|
|
118
|
+
}
|
|
119
|
+
extern "C" int scm2cpp_gmm(double* x, int x_len, double* resp, int resp_len, double* weights, int weights_len, double* means, int means_len, double* prec, int prec_len, double* labels, int labels_len, double* out, int out_len, int maxiter, double tol, double reg, int n, int p, int kc) {
|
|
120
|
+
int scm2cpp_r = gmm(scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(resp, resp_len), scm2cpp::span<double>(weights, weights_len), scm2cpp::span<double>(means, means_len), scm2cpp::span<double>(prec, prec_len), scm2cpp::span<double>(labels, labels_len), scm2cpp::span<double>(out, out_len), maxiter, tol, reg, n, p, kc);
|
|
121
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
122
|
+
{ scm2cpp::span<double> s(resp, resp_len); scm2cpp::cu::need_host(s); }
|
|
123
|
+
{ scm2cpp::span<double> s(weights, weights_len); scm2cpp::cu::need_host(s); }
|
|
124
|
+
{ scm2cpp::span<double> s(means, means_len); scm2cpp::cu::need_host(s); }
|
|
125
|
+
{ scm2cpp::span<double> s(prec, prec_len); scm2cpp::cu::need_host(s); }
|
|
126
|
+
{ scm2cpp::span<double> s(labels, labels_len); scm2cpp::cu::need_host(s); }
|
|
127
|
+
{ scm2cpp::span<double> s(out, out_len); scm2cpp::cu::need_host(s); }
|
|
128
|
+
scm2cpp::cu::end_call();
|
|
129
|
+
return scm2cpp_r;
|
|
130
|
+
}
|
|
131
|
+
extern "C" double scm2cpp_logistic_fg(double* coef, int coef_len, double* g, int g_len, double* x, int x_len, double* y, int y_len, double* z, int z_len, double l2, int multi, int fitint, int n, int p, int k) {
|
|
132
|
+
double scm2cpp_r = logistic_fg(scm2cpp::span<double>(coef, coef_len), scm2cpp::span<double>(g, g_len), scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(y, y_len), scm2cpp::span<double>(z, z_len), l2, multi, fitint, n, p, k);
|
|
133
|
+
{ scm2cpp::span<double> s(coef, coef_len); scm2cpp::cu::need_host(s); }
|
|
134
|
+
{ scm2cpp::span<double> s(g, g_len); scm2cpp::cu::need_host(s); }
|
|
135
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
136
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
137
|
+
{ scm2cpp::span<double> s(z, z_len); scm2cpp::cu::need_host(s); }
|
|
138
|
+
scm2cpp::cu::end_call();
|
|
139
|
+
return scm2cpp_r;
|
|
140
|
+
}
|
|
141
|
+
extern "C" int scm2cpp_logistic_lbfgs(double* x, int x_len, double* y, int y_len, double* coef, int coef_len, double* out, int out_len, double c, int maxiter, double tol, int multi, int fitint, int n, int p, int k) {
|
|
142
|
+
int scm2cpp_r = logistic_lbfgs(scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(y, y_len), scm2cpp::span<double>(coef, coef_len), scm2cpp::span<double>(out, out_len), c, maxiter, tol, multi, fitint, n, p, k);
|
|
143
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
144
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
145
|
+
{ scm2cpp::span<double> s(coef, coef_len); scm2cpp::cu::need_host(s); }
|
|
146
|
+
{ scm2cpp::span<double> s(out, out_len); scm2cpp::cu::need_host(s); }
|
|
147
|
+
scm2cpp::cu::end_call();
|
|
148
|
+
return scm2cpp_r;
|
|
149
|
+
}
|
|
150
|
+
extern "C" double scm2cpp_huber_fg(double* coef, int coef_len, double* g, int g_len, double* x, int x_len, double* y, int y_len, double* z, int z_len, double epsilon, double alpha, int fitint, int n, int p) {
|
|
151
|
+
double scm2cpp_r = huber_fg(scm2cpp::span<double>(coef, coef_len), scm2cpp::span<double>(g, g_len), scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(y, y_len), scm2cpp::span<double>(z, z_len), epsilon, alpha, fitint, n, p);
|
|
152
|
+
{ scm2cpp::span<double> s(coef, coef_len); scm2cpp::cu::need_host(s); }
|
|
153
|
+
{ scm2cpp::span<double> s(g, g_len); scm2cpp::cu::need_host(s); }
|
|
154
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
155
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
156
|
+
{ scm2cpp::span<double> s(z, z_len); scm2cpp::cu::need_host(s); }
|
|
157
|
+
scm2cpp::cu::end_call();
|
|
158
|
+
return scm2cpp_r;
|
|
159
|
+
}
|
|
160
|
+
extern "C" int scm2cpp_huber(double* x, int x_len, double* y, int y_len, double* coef, int coef_len, double* out, int out_len, double epsilon, double alpha, int maxiter, double tol, int fitint, int n, int p) {
|
|
161
|
+
int scm2cpp_r = huber(scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(y, y_len), scm2cpp::span<double>(coef, coef_len), scm2cpp::span<double>(out, out_len), epsilon, alpha, maxiter, tol, fitint, n, p);
|
|
162
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
163
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
164
|
+
{ scm2cpp::span<double> s(coef, coef_len); scm2cpp::cu::need_host(s); }
|
|
165
|
+
{ scm2cpp::span<double> s(out, out_len); scm2cpp::cu::need_host(s); }
|
|
166
|
+
scm2cpp::cu::end_call();
|
|
167
|
+
return scm2cpp_r;
|
|
168
|
+
}
|
|
169
|
+
extern "C" double scm2cpp_glm_fg(double* coef, int coef_len, double* g, int g_len, double* x, int x_len, double* y, int y_len, double* z, int z_len, int family, double power, double l2, int fitint, int n, int p) {
|
|
170
|
+
double scm2cpp_r = glm_fg(scm2cpp::span<double>(coef, coef_len), scm2cpp::span<double>(g, g_len), scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(y, y_len), scm2cpp::span<double>(z, z_len), family, power, l2, fitint, n, p);
|
|
171
|
+
{ scm2cpp::span<double> s(coef, coef_len); scm2cpp::cu::need_host(s); }
|
|
172
|
+
{ scm2cpp::span<double> s(g, g_len); scm2cpp::cu::need_host(s); }
|
|
173
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
174
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
175
|
+
{ scm2cpp::span<double> s(z, z_len); scm2cpp::cu::need_host(s); }
|
|
176
|
+
scm2cpp::cu::end_call();
|
|
177
|
+
return scm2cpp_r;
|
|
178
|
+
}
|
|
179
|
+
extern "C" int scm2cpp_glm(double* x, int x_len, double* y, int y_len, double* coef, int coef_len, double* out, int out_len, int family, double power, double alpha, int maxiter, double tol, int fitint, int n, int p) {
|
|
180
|
+
int scm2cpp_r = glm(scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(y, y_len), scm2cpp::span<double>(coef, coef_len), scm2cpp::span<double>(out, out_len), family, power, alpha, maxiter, tol, fitint, n, p);
|
|
181
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
182
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
183
|
+
{ scm2cpp::span<double> s(coef, coef_len); scm2cpp::cu::need_host(s); }
|
|
184
|
+
{ scm2cpp::span<double> s(out, out_len); scm2cpp::cu::need_host(s); }
|
|
185
|
+
scm2cpp::cu::end_call();
|
|
186
|
+
return scm2cpp_r;
|
|
187
|
+
}
|
|
188
|
+
extern "C" double scm2cpp_lb_abs(double a) {
|
|
189
|
+
double scm2cpp_r = lb_abs(a);
|
|
190
|
+
scm2cpp::cu::end_call();
|
|
191
|
+
return scm2cpp_r;
|
|
192
|
+
}
|
|
193
|
+
extern "C" double scm2cpp_lb_max(double a, double b) {
|
|
194
|
+
double scm2cpp_r = lb_max(a, b);
|
|
195
|
+
scm2cpp::cu::end_call();
|
|
196
|
+
return scm2cpp_r;
|
|
197
|
+
}
|
|
198
|
+
extern "C" double scm2cpp_lb_min(double a, double b) {
|
|
199
|
+
double scm2cpp_r = lb_min(a, b);
|
|
200
|
+
scm2cpp::cu::end_call();
|
|
201
|
+
return scm2cpp_r;
|
|
202
|
+
}
|
|
203
|
+
extern "C" int scm2cpp_lb_dcstep(double* cs, double fp, double dp, double stpmin, double stpmax) {
|
|
204
|
+
int scm2cpp_r = lb_dcstep(*reinterpret_cast<std::array<double,8>*>(cs), fp, dp, stpmin, stpmax);
|
|
205
|
+
{ scm2cpp::span<double> s(cs, 8); scm2cpp::cu::need_host(s); }
|
|
206
|
+
scm2cpp::cu::end_call();
|
|
207
|
+
return scm2cpp_r;
|
|
208
|
+
}
|
|
209
|
+
extern "C" int scm2cpp_lb_search_start(double* ls, double f, double g, double stp, double stpmin, double stpmax, double ftol) {
|
|
210
|
+
int scm2cpp_r = lb_search_start(*reinterpret_cast<std::array<double,16>*>(ls), f, g, stp, stpmin, stpmax, ftol);
|
|
211
|
+
{ scm2cpp::span<double> s(ls, 16); scm2cpp::cu::need_host(s); }
|
|
212
|
+
scm2cpp::cu::end_call();
|
|
213
|
+
return scm2cpp_r;
|
|
214
|
+
}
|
|
215
|
+
extern "C" int scm2cpp_lb_search_step(double* ls, double* cs, double f, double g, double ftol, double gtol, double xtol, double stpmin, double stpmax) {
|
|
216
|
+
int scm2cpp_r = lb_search_step(*reinterpret_cast<std::array<double,16>*>(ls), *reinterpret_cast<std::array<double,8>*>(cs), f, g, ftol, gtol, xtol, stpmin, stpmax);
|
|
217
|
+
{ scm2cpp::span<double> s(ls, 16); scm2cpp::cu::need_host(s); }
|
|
218
|
+
{ scm2cpp::span<double> s(cs, 8); scm2cpp::cu::need_host(s); }
|
|
219
|
+
scm2cpp::cu::end_call();
|
|
220
|
+
return scm2cpp_r;
|
|
221
|
+
}
|
|
222
|
+
extern "C" double scm2cpp_lb_dot(double* a, int a_len, double* b, int b_len, int nv) {
|
|
223
|
+
double scm2cpp_r = lb_dot(scm2cpp::span<double>(a, a_len), scm2cpp::span<double>(b, b_len), nv);
|
|
224
|
+
{ scm2cpp::span<double> s(a, a_len); scm2cpp::cu::need_host(s); }
|
|
225
|
+
{ scm2cpp::span<double> s(b, b_len); scm2cpp::cu::need_host(s); }
|
|
226
|
+
scm2cpp::cu::end_call();
|
|
227
|
+
return scm2cpp_r;
|
|
228
|
+
}
|
|
229
|
+
extern "C" double scm2cpp_lb_dot_row(double* mem, int mem_len, int slot, double* v, int v_len, int nv) {
|
|
230
|
+
double scm2cpp_r = lb_dot_row(scm2cpp::span<double>(mem, mem_len), slot, scm2cpp::span<double>(v, v_len), nv);
|
|
231
|
+
{ scm2cpp::span<double> s(mem, mem_len); scm2cpp::cu::need_host(s); }
|
|
232
|
+
{ scm2cpp::span<double> s(v, v_len); scm2cpp::cu::need_host(s); }
|
|
233
|
+
scm2cpp::cu::end_call();
|
|
234
|
+
return scm2cpp_r;
|
|
235
|
+
}
|
|
236
|
+
extern "C" double scm2cpp_lb_dot_rows(double* a, int a_len, int ra, double* b, int b_len, int rb, int nv) {
|
|
237
|
+
double scm2cpp_r = lb_dot_rows(scm2cpp::span<double>(a, a_len), ra, scm2cpp::span<double>(b, b_len), rb, nv);
|
|
238
|
+
{ scm2cpp::span<double> s(a, a_len); scm2cpp::cu::need_host(s); }
|
|
239
|
+
{ scm2cpp::span<double> s(b, b_len); scm2cpp::cu::need_host(s); }
|
|
240
|
+
scm2cpp::cu::end_call();
|
|
241
|
+
return scm2cpp_r;
|
|
242
|
+
}
|
|
243
|
+
extern "C" double scm2cpp_lb_projgr(double* g, int g_len, double* w, int w_len, int ib, double lbv, int nv) {
|
|
244
|
+
double scm2cpp_r = lb_projgr(scm2cpp::span<double>(g, g_len), scm2cpp::span<double>(w, w_len), ib, lbv, nv);
|
|
245
|
+
{ scm2cpp::span<double> s(g, g_len); scm2cpp::cu::need_host(s); }
|
|
246
|
+
{ scm2cpp::span<double> s(w, w_len); scm2cpp::cu::need_host(s); }
|
|
247
|
+
scm2cpp::cu::end_call();
|
|
248
|
+
return scm2cpp_r;
|
|
249
|
+
}
|
|
250
|
+
extern "C" int scm2cpp_lb_hv(double* q, int q_len, double* smem, int smem_len, double* ymem, int ymem_len, double* rho, int rho_len, double* al, int al_len, double theta, int col, int head, int m, int nv) {
|
|
251
|
+
int scm2cpp_r = lb_hv(scm2cpp::span<double>(q, q_len), scm2cpp::span<double>(smem, smem_len), scm2cpp::span<double>(ymem, ymem_len), scm2cpp::span<double>(rho, rho_len), scm2cpp::span<double>(al, al_len), theta, col, head, m, nv);
|
|
252
|
+
{ scm2cpp::span<double> s(q, q_len); scm2cpp::cu::need_host(s); }
|
|
253
|
+
{ scm2cpp::span<double> s(smem, smem_len); scm2cpp::cu::need_host(s); }
|
|
254
|
+
{ scm2cpp::span<double> s(ymem, ymem_len); scm2cpp::cu::need_host(s); }
|
|
255
|
+
{ scm2cpp::span<double> s(rho, rho_len); scm2cpp::cu::need_host(s); }
|
|
256
|
+
{ scm2cpp::span<double> s(al, al_len); scm2cpp::cu::need_host(s); }
|
|
257
|
+
scm2cpp::cu::end_call();
|
|
258
|
+
return scm2cpp_r;
|
|
259
|
+
}
|
|
260
|
+
extern "C" double scm2cpp_lb_vbv(double* v, int v_len, double* smem, int smem_len, double* ymem, int ymem_len, double* rho, int rho_len, double* bm, int bm_len, double* sb, int sb_len, double theta, int col, int head, int m, int nv) {
|
|
261
|
+
double scm2cpp_r = lb_vbv(scm2cpp::span<double>(v, v_len), scm2cpp::span<double>(smem, smem_len), scm2cpp::span<double>(ymem, ymem_len), scm2cpp::span<double>(rho, rho_len), scm2cpp::span<double>(bm, bm_len), scm2cpp::span<double>(sb, sb_len), theta, col, head, m, nv);
|
|
262
|
+
{ scm2cpp::span<double> s(v, v_len); scm2cpp::cu::need_host(s); }
|
|
263
|
+
{ scm2cpp::span<double> s(smem, smem_len); scm2cpp::cu::need_host(s); }
|
|
264
|
+
{ scm2cpp::span<double> s(ymem, ymem_len); scm2cpp::cu::need_host(s); }
|
|
265
|
+
{ scm2cpp::span<double> s(rho, rho_len); scm2cpp::cu::need_host(s); }
|
|
266
|
+
{ scm2cpp::span<double> s(bm, bm_len); scm2cpp::cu::need_host(s); }
|
|
267
|
+
{ scm2cpp::span<double> s(sb, sb_len); scm2cpp::cu::need_host(s); }
|
|
268
|
+
scm2cpp::cu::end_call();
|
|
269
|
+
return scm2cpp_r;
|
|
270
|
+
}
|
|
271
|
+
extern "C" int scm2cpp_lb_direction(double* w, int w_len, double* g, int g_len, double* d, int d_len, double* q, int q_len, double* e, int e_len, double* smem, int smem_len, double* ymem, int ymem_len, double* rho, int rho_len, double* al, int al_len, double* bm, int bm_len, double* sb, int sb_len, double theta, int col, int head, int m, int ib, double lbv, int nv) {
|
|
272
|
+
int scm2cpp_r = lb_direction(scm2cpp::span<double>(w, w_len), scm2cpp::span<double>(g, g_len), scm2cpp::span<double>(d, d_len), scm2cpp::span<double>(q, q_len), scm2cpp::span<double>(e, e_len), scm2cpp::span<double>(smem, smem_len), scm2cpp::span<double>(ymem, ymem_len), scm2cpp::span<double>(rho, rho_len), scm2cpp::span<double>(al, al_len), scm2cpp::span<double>(bm, bm_len), scm2cpp::span<double>(sb, sb_len), theta, col, head, m, ib, lbv, nv);
|
|
273
|
+
{ scm2cpp::span<double> s(w, w_len); scm2cpp::cu::need_host(s); }
|
|
274
|
+
{ scm2cpp::span<double> s(g, g_len); scm2cpp::cu::need_host(s); }
|
|
275
|
+
{ scm2cpp::span<double> s(d, d_len); scm2cpp::cu::need_host(s); }
|
|
276
|
+
{ scm2cpp::span<double> s(q, q_len); scm2cpp::cu::need_host(s); }
|
|
277
|
+
{ scm2cpp::span<double> s(e, e_len); scm2cpp::cu::need_host(s); }
|
|
278
|
+
{ scm2cpp::span<double> s(smem, smem_len); scm2cpp::cu::need_host(s); }
|
|
279
|
+
{ scm2cpp::span<double> s(ymem, ymem_len); scm2cpp::cu::need_host(s); }
|
|
280
|
+
{ scm2cpp::span<double> s(rho, rho_len); scm2cpp::cu::need_host(s); }
|
|
281
|
+
{ scm2cpp::span<double> s(al, al_len); scm2cpp::cu::need_host(s); }
|
|
282
|
+
{ scm2cpp::span<double> s(bm, bm_len); scm2cpp::cu::need_host(s); }
|
|
283
|
+
{ scm2cpp::span<double> s(sb, sb_len); scm2cpp::cu::need_host(s); }
|
|
284
|
+
scm2cpp::cu::end_call();
|
|
285
|
+
return scm2cpp_r;
|
|
286
|
+
}
|
|
287
|
+
extern "C" int scm2cpp_lbfgs(int kind, double* w, int w_len, double* x, int x_len, double* y, int y_len, double* aux, double* work, int work_len, double* out, int out_len, int m, int maxiter, double pgtol, double ftol, int maxls, int ib, double lbv, int nv, int n, int p, int k) {
|
|
288
|
+
int scm2cpp_r = lbfgs(kind, scm2cpp::span<double>(w, w_len), scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(y, y_len), *reinterpret_cast<std::array<double,4>*>(aux), scm2cpp::span<double>(work, work_len), scm2cpp::span<double>(out, out_len), m, maxiter, pgtol, ftol, maxls, ib, lbv, nv, n, p, k);
|
|
289
|
+
{ scm2cpp::span<double> s(w, w_len); scm2cpp::cu::need_host(s); }
|
|
290
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
291
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
292
|
+
{ scm2cpp::span<double> s(aux, 4); scm2cpp::cu::need_host(s); }
|
|
293
|
+
{ scm2cpp::span<double> s(work, work_len); scm2cpp::cu::need_host(s); }
|
|
294
|
+
{ scm2cpp::span<double> s(out, out_len); scm2cpp::cu::need_host(s); }
|
|
295
|
+
scm2cpp::cu::end_call();
|
|
296
|
+
return scm2cpp_r;
|
|
297
|
+
}
|
|
298
|
+
extern "C" double scm2cpp_lbfgs_fg(int kind, double* w, int w_len, double* g, int g_len, double* x, int x_len, double* y, int y_len, double* aux, double* work, int work_len, int n, int p, int k) {
|
|
299
|
+
double scm2cpp_r = lbfgs_fg(kind, scm2cpp::span<double>(w, w_len), scm2cpp::span<double>(g, g_len), scm2cpp::span<double>(x, x_len), scm2cpp::span<double>(y, y_len), *reinterpret_cast<std::array<double,4>*>(aux), scm2cpp::span<double>(work, work_len), n, p, k);
|
|
300
|
+
{ scm2cpp::span<double> s(w, w_len); scm2cpp::cu::need_host(s); }
|
|
301
|
+
{ scm2cpp::span<double> s(g, g_len); scm2cpp::cu::need_host(s); }
|
|
302
|
+
{ scm2cpp::span<double> s(x, x_len); scm2cpp::cu::need_host(s); }
|
|
303
|
+
{ scm2cpp::span<double> s(y, y_len); scm2cpp::cu::need_host(s); }
|
|
304
|
+
{ scm2cpp::span<double> s(aux, 4); scm2cpp::cu::need_host(s); }
|
|
305
|
+
{ scm2cpp::span<double> s(work, work_len); scm2cpp::cu::need_host(s); }
|
|
306
|
+
scm2cpp::cu::end_call();
|
|
307
|
+
return scm2cpp_r;
|
|
308
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
#include "gramops.hpp"
|
|
3
|
+
// #include "scm2cpp.hpp"
|
|
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
|
+
|