diff --git a/include/ircd/gpt/pipe/model.h b/include/ircd/gpt/pipe/model.h index 7365839d2..1bdf39eb8 100644 --- a/include/ircd/gpt/pipe/model.h +++ b/include/ircd/gpt/pipe/model.h @@ -93,6 +93,22 @@ struct ircd::gpt::pipe::model::block block(gpt::model::block &, const size_t); }; +struct ircd::gpt::pipe::model::language +{ + cl::data + master[3]; + + matrix + pos, + token; + + language(cl::data *, const off_t, const gpt::model::embed &); + language(cl::data *, const off_t, gpt::model::embed &); + language(const gpt::model::embed &); + language( gpt::model::embed &); + ~language() noexcept; +}; + struct ircd::gpt::pipe::model::decoder { // Combined-layer memory roots @@ -110,17 +126,3 @@ struct ircd::gpt::pipe::model::decoder decoder(gpt::model::decoder &); ~decoder() noexcept; }; - -struct ircd::gpt::pipe::model::language -{ - cl::data - master[3]; - - matrix - pos, - token; - - language(const gpt::model::embed &); - language(gpt::model::embed &); - ~language() noexcept; -}; diff --git a/ircd/gpt_pipe.cc b/ircd/gpt_pipe.cc index c8bc6fd83..599e0c496 100644 --- a/ircd/gpt_pipe.cc +++ b/ircd/gpt_pipe.cc @@ -696,70 +696,6 @@ noexcept { } -// -// pipe::model::language -// - -ircd::gpt::pipe::model::language::language(gpt::model::embed &embed) -:master -{ - // params - { - sizeof(embed), mutable_buffer - { - reinterpret_cast(&embed), - sizeof(embed), - } - }, - - // first moment - { - sizeof(embed), mutable_buffer{}, - }, - - // second moment - { - sizeof(embed), mutable_buffer{}, - }, -} -,pos -{ - master, 0, mutable_buffer{embed.pos} -} -,token -{ - master, sizeof(embed.pos), mutable_buffer{embed.token} -} -{ -} - -ircd::gpt::pipe::model::language::language(const gpt::model::embed &embed) -:master -{ - { - sizeof(embed), const_buffer - { - reinterpret_cast(&embed), - sizeof(embed), - } - }, -} -,pos -{ - master, 0, const_buffer{embed.pos} -} -,token -{ - master, sizeof(embed.pos), const_buffer{embed.token} -} -{ -} - -ircd::gpt::pipe::model::language::~language() -noexcept -{ -} - // // pipe::model::decoder // @@ -855,6 +791,98 @@ noexcept { } +// +// pipe::model::language +// + +ircd::gpt::pipe::model::language::language(gpt::model::embed &embed) +:master +{ + // params + { + sizeof(embed), mutable_buffer + { + reinterpret_cast(&embed), + sizeof(embed), + } + }, + + // first moment + { + sizeof(embed), mutable_buffer{}, + }, + + // second moment + { + sizeof(embed), mutable_buffer{}, + }, +} +,pos +{ + master, 0, mutable_buffer{embed.pos} +} +,token +{ + master, sizeof(embed.pos), mutable_buffer{embed.token} +} +{ +} + +ircd::gpt::pipe::model::language::language(const gpt::model::embed &embed) +:master +{ + { + sizeof(embed), const_buffer + { + reinterpret_cast(&embed), + sizeof(embed), + } + }, +} +,pos +{ + master, 0, const_buffer{embed.pos} +} +,token +{ + master, sizeof(embed.pos), const_buffer{embed.token} +} +{ +} + +ircd::gpt::pipe::model::language::language(cl::data *const master, + const off_t offset, + gpt::model::embed &embed) +:pos +{ + master, offset, mutable_buffer{embed.pos} +} +,token +{ + master, offset + off_t(sizeof(embed.pos)), mutable_buffer{embed.token} +} +{ +} + +ircd::gpt::pipe::model::language::language(cl::data *const master, + const off_t offset, + const gpt::model::embed &embed) +:pos +{ + master, offset, const_buffer{embed.pos} +} +,token +{ + master, offset + off_t(sizeof(embed.pos)), const_buffer{embed.token} +} +{ +} + +ircd::gpt::pipe::model::language::~language() +noexcept +{ +} + // // pipe::model::block //