Initial checkpoint with reasonable workflow
This commit is contained in:
parent
5db9abd06e
commit
9aae5d69db
46 changed files with 1158 additions and 695 deletions
|
|
@ -52,7 +52,7 @@ void KomputeModelML::train(std::vector<float> yData, std::vector<float> xIData,
|
|||
sq->record<kp::OpTensorSyncDevice>({ wIn, bIn });
|
||||
|
||||
// Newer versions of Android are able to use shaderc to read raw string
|
||||
sq->record<kp::OpAlgoBase>(
|
||||
sq->record<kp::OpAlgoCreate>(
|
||||
params, kp::Shader::compile_source(LR_SHADER));
|
||||
|
||||
sq->record<kp::OpTensorSyncLocal>({ wOutI, wOutJ, bOut, lOut });
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ int main()
|
|||
}
|
||||
)");
|
||||
|
||||
mgr.evalOpDefault<kp::OpAlgoBase>(
|
||||
mgr.evalOpDefault<kp::OpAlgoCreate>(
|
||||
{ tensorInA, tensorInB, tensorOut },
|
||||
kp::Shader::compile_source(shader));
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ void KomputeSummatorNode::_init() {
|
|||
{ this->mSecondaryTensor });
|
||||
|
||||
// Then we run the operation with both tensors
|
||||
sq->record<kp::OpAlgoBase>(
|
||||
sq->record<kp::OpAlgoCreate>(
|
||||
{ this->mPrimaryTensor, this->mSecondaryTensor },
|
||||
kp::Shader::compile_source(shader));
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ void KomputeSummator::_init() {
|
|||
{ this->mSecondaryTensor });
|
||||
|
||||
// Then we run the operation with both tensors
|
||||
this->mSequence->record<kp::OpAlgoBase>(
|
||||
this->mSequence->record<kp::OpAlgoCreate>(
|
||||
{ this->mPrimaryTensor, this->mSecondaryTensor },
|
||||
kp::Shader::compile_source(shader));
|
||||
|
||||
|
|
|
|||
|
|
@ -62,11 +62,11 @@ void KomputeModelMLNode::train(Array yArr, Array xIArr, Array xJArr) {
|
|||
|
||||
#ifdef KOMPUTE_ANDROID_SHADER_FROM_STRING
|
||||
// Newer versions of Android are able to use shaderc to read raw string
|
||||
sq->record<kp::OpAlgoBase>(
|
||||
sq->record<kp::OpAlgoCreate>(
|
||||
params, std::vector<char>(LR_SHADER.begin(), LR_SHADER.end()));
|
||||
#else
|
||||
// Older versions of Android require the SPIRV binary directly
|
||||
sq->record<kp::OpAlgoBase>(
|
||||
sq->record<kp::OpAlgoCreate>(
|
||||
params, std::vector<char>(
|
||||
kp::shader_data::shaders_glsl_logisticregression_comp_spv,
|
||||
kp::shader_data::shaders_glsl_logisticregression_comp_spv
|
||||
|
|
|
|||
|
|
@ -66,11 +66,11 @@ void KomputeModelML::train(Array yArr, Array xIArr, Array xJArr) {
|
|||
|
||||
#ifdef KOMPUTE_ANDROID_SHADER_FROM_STRING
|
||||
// Newer versions of Android are able to use shaderc to read raw string
|
||||
sq->record<kp::OpAlgoBase>(
|
||||
sq->record<kp::OpAlgoCreate>(
|
||||
params, std::vector<char>(LR_SHADER.begin(), LR_SHADER.end()));
|
||||
#else
|
||||
// Older versions of Android require the SPIRV binary directly
|
||||
sq->record<kp::OpAlgoBase>(
|
||||
sq->record<kp::OpAlgoCreate>(
|
||||
params, std::vector<char>(
|
||||
kp::shader_data::shaders_glsl_logisticregression_comp_spv,
|
||||
kp::shader_data::shaders_glsl_logisticregression_comp_spv
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ int main()
|
|||
|
||||
sq->record<kp::OpTensorSyncDevice>({ wIn, bIn });
|
||||
|
||||
sq->record<kp::OpAlgoBase>(
|
||||
sq->record<kp::OpAlgoCreate>(
|
||||
params, std::vector<uint32_t>(
|
||||
(uint32_t*)kp::shader_data::shaders_glsl_logisticregression_comp_spv,
|
||||
(uint32_t*)(kp::shader_data::shaders_glsl_logisticregression_comp_spv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue