54 lines
1.9 KiB
C++
54 lines
1.9 KiB
C++
import std;
|
|
import Crafter.Build;
|
|
namespace fs = std::filesystem;
|
|
using namespace Crafter;
|
|
|
|
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
|
|
constexpr std::array<std::string_view, 8> mathInterfaces = {
|
|
"interfaces/Crafter.Math-Basic",
|
|
"interfaces/Crafter.Math",
|
|
"interfaces/Crafter.Math-Common",
|
|
"interfaces/Crafter.Math-Vector",
|
|
"interfaces/Crafter.Math-Intersection",
|
|
"interfaces/Crafter.Math-MatrixRowMajor",
|
|
"interfaces/Crafter.Math-VectorF16",
|
|
"interfaces/Crafter.Math-VectorF32",
|
|
};
|
|
|
|
Configuration cfg;
|
|
cfg.path = "./";
|
|
cfg.name = "Crafter.Math";
|
|
cfg.outputName = "Crafter.Math";
|
|
cfg.type = ConfigurationType::LibraryStatic;
|
|
ApplyStandardArgs(cfg, args);
|
|
{
|
|
std::array<fs::path, 8> ifaces;
|
|
std::ranges::copy(mathInterfaces, ifaces.begin());
|
|
std::array<fs::path, 0> impls = {};
|
|
cfg.GetInterfacesAndImplementations(ifaces, impls);
|
|
}
|
|
|
|
auto addTest = [&](std::string_view testName, std::string march, std::string mtune) {
|
|
Test t;
|
|
t.config.path = "./";
|
|
t.config.name = std::format("{}-{}", testName, march);
|
|
t.config.outputName = t.config.name;
|
|
t.config.target = cfg.target;
|
|
t.config.type = ConfigurationType::Executable;
|
|
t.config.march = march;
|
|
t.config.mtune = mtune;
|
|
t.config.debug = cfg.debug;
|
|
std::array<fs::path, 8> ifaces;
|
|
std::ranges::copy(mathInterfaces, ifaces.begin());
|
|
std::array<fs::path, 1> impls = { fs::path{std::format("tests/{}", testName)} };
|
|
t.config.GetInterfacesAndImplementations(ifaces, impls);
|
|
cfg.tests.push_back(std::move(t));
|
|
};
|
|
for (std::string_view name : { "Vector", "Intersection", "Matrix" }) {
|
|
addTest(name, "sapphirerapids", "native");
|
|
addTest(name, "x86-64-v4", "generic");
|
|
addTest(name, "x86-64-v3", "generic");
|
|
}
|
|
|
|
return cfg;
|
|
}
|