Skip to content

CI runners #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions main.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include <random>
#include <algorithm>
#include <iterator>
#include <vector>
#include <iostream>
#include <cublas_v2.h>
Expand All @@ -7,28 +10,21 @@
#define real_t double


int main() {
size_t m = 3;
size_t n = 7;
std::vector<real_t> mat{1, -2, 3, 4, -1, -1, -1,
1, 2, -3, 4, -1, -1, -1,
-1, 3, 5, -7, -1, -1, -1};
DTensor mats(m, n, 1);
mats.upload(mat, rowMajor);

Nullspace ns = Nullspace(mats);
int main() {
// cudaStream_t stream1;
// cudaStreamCreate(&stream1);
// cublasSetStream(Session::getInstance().cuBlasHandle(), stream1);

std::vector<real_t> vec{1, 2, 3, 4, 5, 6, 7};
DTensor vecs(vec, n);
cudaStream_t s1;
cudaStreamCreate(&s1);

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

std::cout << mats << "\n";
std::cout << vecs << "\n";
std::cout << svd.singularValues();

DTensor op(m, 1, 1);
op.addAB(mats, vecs);
std::cout << op << "\n";

return 0;
}