Skip to content

Commit f62aa1c

Browse files
authored
Merge pull request #40 from GPUEngineering/hf/ci-runners
some changes
2 parents 8749677 + e452ba9 commit f62aa1c

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

main.cu

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#include <random>
2+
#include <algorithm>
3+
#include <iterator>
14
#include <vector>
25
#include <iostream>
36
#include <cublas_v2.h>
@@ -7,28 +10,21 @@
710
#define real_t double
811

912

10-
int main() {
11-
size_t m = 3;
12-
size_t n = 7;
13-
std::vector<real_t> mat{1, -2, 3, 4, -1, -1, -1,
14-
1, 2, -3, 4, -1, -1, -1,
15-
-1, 3, 5, -7, -1, -1, -1};
16-
DTensor mats(m, n, 1);
17-
mats.upload(mat, rowMajor);
1813

19-
Nullspace ns = Nullspace(mats);
14+
int main() {
15+
// cudaStream_t stream1;
16+
// cudaStreamCreate(&stream1);
17+
// cublasSetStream(Session::getInstance().cuBlasHandle(), stream1);
2018

21-
std::vector<real_t> vec{1, 2, 3, 4, 5, 6, 7};
22-
DTensor vecs(vec, n);
19+
cudaStream_t s1;
20+
cudaStreamCreate(&s1);
2321

24-
ns.project(vecs);
22+
auto a = DTensor<float>::createRandomTensor(2000, 200, 1, -2, 2);
23+
Svd svd(a);
24+
svd.factorise();
2525

26-
std::cout << mats << "\n";
27-
std::cout << vecs << "\n";
26+
std::cout << svd.singularValues();
2827

29-
DTensor op(m, 1, 1);
30-
op.addAB(mats, vecs);
31-
std::cout << op << "\n";
3228

3329
return 0;
3430
}

0 commit comments

Comments
 (0)