-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
784aba0
commit 1240508
Showing
7 changed files
with
201 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Numerical examples | ||
|
||
The Universal library contains parameterized number systems to aid in the research to create custom | ||
algorithms that are tailored to the arithmetic requirements of the applications. In high-performance | ||
and real-time applications, this tailored number system approach has been a common approach to | ||
maximize performance and/or performance per Watt. More recently, Deep Learning has rekindled the | ||
interest in tailored number systems as training DNNs is a lengthy affair and improving computational | ||
performance by minimizing hardware, memory or network bandwidth, had immediate commercial benefits. | ||
As Deep Learning AI is getting embedded in stand-alone devices, the benefit of multi-precision | ||
number system optimizations is broadening to any application that uses deep computes to deliver | ||
knowledge generation or decision making. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
// generators.hpp: matrix generators | ||
// | ||
// Copyright (C) 2017-2020 Stillwater Supercomputing, Inc. | ||
// | ||
// This file is part of the universal numbers project, which is released under an MIT Open Source license. | ||
|
||
#include "vector.hpp" | ||
#include "matrix.hpp" | ||
|
||
// matrix generators | ||
#include "uniform_random.hpp" | ||
#include "laplace2D.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
// laplace2D.hpp: generate 2D Laplace operator difference matrix on a square domain | ||
// | ||
// Copyright (C) 2017-2020 Stillwater Supercomputing, Inc. | ||
// | ||
// This file is part of the universal numbers project, which is released under an MIT Open Source license. | ||
#include <universal/blas/blas.hpp> | ||
//#include <universal/posit/posit_fwd.hpp> | ||
|
||
namespace sw { namespace unum { namespace blas { | ||
|
||
// generate a 2D square domain Laplacian difference equation matrix | ||
template<typename Scalar> | ||
void laplace2D(matrix<Scalar>& A, size_t m, size_t n) { | ||
A.resize(m,n); | ||
A.setzero(); | ||
assert(A.rows() == m * n); | ||
for (size_t i = 0; i < m; ++i) { | ||
for (size_t j = 0; j < n; ++j) { | ||
Scalar four(4.0), minus_one(-1.0); | ||
size_t row = i * n + j; | ||
A(row, row) = four; | ||
if (j < n - 1) A(row, row + 1) = minus_one; | ||
if (i < m - 1) A(row, row + n) = minus_one; | ||
if (j > 0) A(row, row - 1) = minus_one; | ||
if (i > 0) A(row, row - n) = minus_one; | ||
} | ||
} | ||
} | ||
|
||
}}} // namespace sw::unum::blas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.