Mentions légales du service

Skip to content
Snippets Groups Projects
Commit abd34faa authored by hhakim's avatar hhakim
Browse files

Cast properly lambda/beta scalar argument in gemm calls to avoid...

Cast properly lambda/beta scalar argument in gemm calls to avoid non-consistent/non-defined calls mixing float and double types.
parent 9d0fe010
Branches
Tags
No related merge requests found
......@@ -237,7 +237,7 @@ void Faust::Palm4MSA<FPP,DEVICE,FPP2>::compute_grad_over_c_ext_opt()
else
facts = {&LorR, &error, &RorL[m_indFact]};
tc_flags = {TorH, 'N', TorH};
mul_3_facts(facts, grad_over_c, (FPP) m_lambda/c, (FPP)0, tc_flags);
mul_3_facts(facts, grad_over_c, FPP(m_lambda/c), (FPP)0, tc_flags);
isGradComputed = true;
}
......@@ -392,14 +392,14 @@ sprintf(nomFichier,"error_1_%d_device.tmp",cmpt);*/
// tmp3 = m_lambda*L'*error (= m_lambda*L' * (m_lambda*L*S*R - data) )
gemm(LorR, error, tmp3, FPP(m_lambda),(FPP) 0.0, TorH, 'N', blas_handle);
// grad_over_c = 1/c*tmp3*R' (= 1/c*m_lambda*L' * (m_lambda*L*S*R - data) * R' )
gemm(tmp3, RorL[m_indFact], grad_over_c,(FPP) 1.0/c,(FPP) 0.0,'N',TorH, blas_handle);
gemm(tmp3, RorL[m_indFact], grad_over_c, FPP(1.0/c),(FPP) 0.0,'N',TorH, blas_handle);
}
else
{
// tmp3 = m_lambda*L'*error (= m_lambda*L' * (m_lambda*L*S*R - data) )
gemm(RorL[m_indFact], error, tmp3, FPP(m_lambda), (FPP) 0.0, TorH, 'N', blas_handle);
// grad_over_c = 1/c*tmp3*R' (= 1/c*m_lambda*L' * (m_lambda*L*S*R - data) * R' )
gemm(tmp3, LorR, grad_over_c, (FPP) 1.0/c, (FPP) (FPP) 0.0,'N',TorH, blas_handle);
gemm(tmp3, LorR, grad_over_c, FPP(1.0/c), (FPP) (FPP) 0.0,'N',TorH, blas_handle);
}
}
else // computing error*R' first, then L'*(error*R')
......@@ -409,14 +409,14 @@ sprintf(nomFichier,"error_1_%d_device.tmp",cmpt);*/
// tmp3 = m_lambda*error*R' (= m_lambda*(m_lambda*L*S*R - data) * R' )
gemm(error, RorL[m_indFact], tmp3, FPP(m_lambda), (FPP) 0.0, 'N', TorH, blas_handle);
// grad_over_c = 1/c*L'*tmp3 (= 1/c*L' * m_lambda*(m_lambda*L*S*R - data) * R' )
gemm(LorR, tmp3, grad_over_c,(FPP) 1.0/c, (FPP) 0.0,TorH,'N', blas_handle);
gemm(LorR, tmp3, grad_over_c, FPP(1.0/c), (FPP) 0.0,TorH,'N', blas_handle);
}
else
{
// tmp3 = m_lambda*error*R' (= m_lambda * (m_lambda*L*S*R - data) * R' )
gemm(error, LorR, tmp3, FPP(m_lambda), (FPP) 0.0, 'N', TorH, blas_handle);
// grad_over_c = 1/c*L'*tmp3 (= 1/c*L' * m_lambda*(m_lambda*L*S*R - data) * R' )
gemm(RorL[m_indFact], tmp3, grad_over_c, (FPP) 1.0/c, (FPP) 0.0,TorH,'N', blas_handle);
gemm(RorL[m_indFact], tmp3, grad_over_c, FPP(1.0/c), (FPP) 0.0,TorH,'N', blas_handle);
}
}
......
......@@ -111,7 +111,7 @@ void Palm4MSAFGFT<FPP,DEVICE,FPP2>::compute_grad_over_c()
gemm(tmp1, this->LorR, tmp2, FPP(this->m_lambda), (FPP) 0, 'N', this->TorH, this->blas_handle);
}
// grad_over_c = 1/this->c*tmp3*tmp2
gemm(tmp3, tmp2, this->grad_over_c, (FPP) 1.0/this->c, (FPP) 0.0,'N','N', this->blas_handle);
gemm(tmp3, tmp2, this->grad_over_c, (FPP) (1.0/this->c), (FPP) 0.0,'N','N', this->blas_handle);
}
else // computing this->error*R' first, then L'*(this->error*lambda*LSRD*R')
......@@ -123,7 +123,7 @@ void Palm4MSAFGFT<FPP,DEVICE,FPP2>::compute_grad_over_c()
// tmp3 = this->m_lambda*this->error*tmp2
gemm(this->error, tmp2, tmp3, FPP(this->m_lambda), (FPP) 0.0, 'N', 'N', this->blas_handle);
// grad_over_c = 1/this->c*L'*tmp3
gemm(this->LorR, tmp3, this->grad_over_c,(FPP) 1.0/this->c, (FPP) 0.0,this->TorH,'N', this->blas_handle);
gemm(this->LorR, tmp3, this->grad_over_c,(FPP) (1.0/this->c), (FPP) 0.0,this->TorH,'N', this->blas_handle);
}
else
{
......@@ -132,7 +132,7 @@ void Palm4MSAFGFT<FPP,DEVICE,FPP2>::compute_grad_over_c()
// tmp3 = this->m_lambda*this->error*tmp2
gemm(this->error, tmp2, tmp3, FPP(this->m_lambda), (FPP) 0.0, 'N', 'N', this->blas_handle);
// grad_over_c = 1/this->c*L'*tmp3
gemm(this->RorL[this->m_indFact], tmp3, this->grad_over_c, (FPP) 1.0/this->c, (FPP) 0.0,this->TorH,'N', this->blas_handle);
gemm(this->RorL[this->m_indFact], tmp3, this->grad_over_c, (FPP) (1.0/this->c), (FPP) 0.0,this->TorH,'N', this->blas_handle);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment