fully operational F16
This commit is contained in:
parent
a6bf3ca572
commit
7bd67a2cb9
4 changed files with 944 additions and 1172 deletions
52
tests/VectorF16.cpp
Normal file
52
tests/VectorF16.cpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Crafter® Build
|
||||
Copyright (C) 2026 Catcrafts®
|
||||
Catcrafts.net
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License version 3.0 as published by the Free Software Foundation;
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
import Crafter.Math;
|
||||
import std;
|
||||
using namespace Crafter;
|
||||
|
||||
extern "C" {
|
||||
std::string* RunTest() {
|
||||
{
|
||||
_Float16 floats[] {0,1,2,3,4,5,6,7,8};
|
||||
VectorF16<8, 1> vec1(floats);
|
||||
|
||||
Vector<_Float16, 8, VectorF16<8, 1>::Alignment> stored = vec1.Store();
|
||||
for(std::uint8_t i = 0; i < 8; i++) {
|
||||
if(stored.v[i] != floats[i]) {
|
||||
return new std::string("Load Store does not match");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
_Float16 floats[] {0,1,2,3,4,5,6,7,8};
|
||||
VectorF16<8, 1> vec1(floats);
|
||||
VectorF16<8, 1> result = vec1 + vec1;
|
||||
Vector<_Float16, 8, VectorF16<8, 1>::Alignment> stored = result.Store();
|
||||
for(std::uint8_t i = 0; i < 8; i++) {
|
||||
if(stored.v[i] != floats[i] + floats[i]) {
|
||||
return new std::string("Add does not match");
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue