0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-11 06:28:55 +02:00

ircd::gpt::pipe: Add conf item for default source paths and opts for now.

This commit is contained in:
Jason Volk 2021-08-27 18:02:33 -07:00
parent 3859a13293
commit 6e7e56f081
3 changed files with 43 additions and 14 deletions

View file

@ -15,7 +15,8 @@
struct ircd::gpt::pipe::code
:cl::code
{
static const string_view compile_opts;
static conf::item<std::string> default_path;
static conf::item<std::string> default_opts;
code();
~code() noexcept;

View file

@ -8,6 +8,9 @@
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
#include <ircd/simt/simt.h>
#include <ircd/gpt/token.h>
#include <ircd/gpt/task/task.h>
inline void
__attribute__((always_inline))

View file

@ -363,27 +363,42 @@ noexcept
// code
//
decltype(ircd::gpt::pipe::code::compile_opts)
ircd::gpt::pipe::code::compile_opts
decltype(ircd::gpt::pipe::code::default_path)
ircd::gpt::pipe::code::default_path
{
" -cl-strict-aliasing"
" -cl-no-signed-zeros"
" -cl-finite-math-only"
" -cl-unsafe-math-optimizations"
" -cl-fast-relaxed-math"
" -cl-mad-enable"
" -cl-single-precision-constant"
//" -cl-fp32-correctly-rounded-divide-sqrt"
{ "name", "ircd.gpt.pipe.code.path" },
};
" -cl-kernel-arg-info"
decltype(ircd::gpt::pipe::code::default_opts)
ircd::gpt::pipe::code::default_opts
{
{ "name", "ircd.gpt.pipe.code.opts" },
{ "default", string_view
{
" -cl-strict-aliasing"
" -cl-no-signed-zeros"
" -cl-finite-math-only"
" -cl-unsafe-math-optimizations"
" -cl-fast-relaxed-math"
" -cl-mad-enable"
" -cl-single-precision-constant"
//" -cl-fp32-correctly-rounded-divide-sqrt"
" -cl-kernel-arg-info"
}}
};
ircd::gpt::pipe::code::code()
:cl::code{[]
{
const string_view code_path
{
default_path
};
const fs::fd fd
{
code_path
};
const std::string read
@ -401,9 +416,19 @@ ircd::gpt::pipe::code::code()
&bin, 1
);
const auto opts
{
fmt::snstringf
{
4096, "%s -I%s",
string_view{default_opts},
string_view{fs::base::include},
}
};
return cl::code
{
bins, compile_opts
bins, opts
};
}()}
{