Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sébastien Villemot
dynare
Commits
5a2df7b3
Verified
Commit
5a2df7b3
authored
3 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Improve test file
parent
538ffdc8
Branches
asm
No related tags found
No related merge requests found
Pipeline
#6179
failed
3 years ago
Stage: build
Stage: test
Stage: pkg
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/particle/local_state_space_iteration_k_test.mod
+46
-13
46 additions, 13 deletions
tests/particle/local_state_space_iteration_k_test.mod
with
46 additions
and
13 deletions
tests/particle/local_state_space_iteration_k_test.mod
+
46
−
13
View file @
5a2df7b3
...
...
@@ -47,31 +47,64 @@ rf_ghxx = dr.ghxx(dr.restrict_var_list, :);
rf_ghuu = dr.ghuu(dr.restrict_var_list, :);
rf_ghxu = dr.ghxu(dr.restrict_var_list, :);
setenv("DYNARE_LSSI2_KERNEL", "avx512")
// Dry run for making sure that the MEX is loaded in memory
dummy = local_state_space_iteration_2(yhat(:,1), epsilon(:,1), rf_ghx, rf_ghu, rf_constant, rf_ghxx, rf_ghuu, rf_ghxu, 1);
disp('* Multi-threaded comparison')
disp('kernel=avx512')
setenv('DYNARE_LSSI2_KERNEL', 'avx512')
tic;
ynext1 = local_state_space_iteration_2(yhat, epsilon, rf_ghx, rf_ghu, rf_constant, rf_ghxx, rf_ghuu, rf_ghxu, options_.threads.local_state_space_iteration_2);
toc;
setenv("DYNARE_LSSI2_KERNEL", "avx2")
disp('kernel=avx2')
setenv('DYNARE_LSSI2_KERNEL', 'avx2')
tic;
ynext2 = local_state_space_iteration_2(yhat, epsilon, rf_ghx, rf_ghu, rf_constant, rf_ghxx, rf_ghuu, rf_ghxu, options_.threads.local_state_space_iteration_2);
toc;
setenv("DYNARE_LSSI2_KERNEL", "generic")
disp('kernel=generic')
setenv('DYNARE_LSSI2_KERNEL', 'generic')
tic;
ynext3 = local_state_space_iteration_2(yhat, epsilon, rf_ghx, rf_ghu, rf_constant, rf_ghxx, rf_ghuu, rf_ghxu, options_.threads.local_state_space_iteration_2);
toc;
setenv("DYNARE_LSSI2_KERNEL", "auto")
if max(max(abs(ynext1-ynext3))) > 1e-15
error('avx512 kernel is inconsistent with generic one')
end
if max(max(abs(ynext2-ynext3))) > 1e-15
error('avx2 kernel is inconsistent with generic one')
end
disp('')
disp('* Single-threaded comparison')
max(max(abs(ynext1-ynext3)))
max(max(abs(ynext2-ynext3)))
options_.threads.local_state_space_iteration_2 = 1;
/*
expected = rf_constant+rf_ghx*yhat+rf_ghu*epsilon;
for i=1:nparticles
expected(:,i) = expected(:,i)+A_times_B_kronecker_C(.5*rf_ghxx,yhat(:,i))+A_times_B_kronecker_C(.5*rf_ghuu,epsilon(:,i))+A_times_B_kronecker_C(rf_ghxu,yhat(:,i),epsilon(:,i));
>>>>>>> 8e033b864 (WIP: AVX2 version of lssi2)
disp('kernel=avx512')
setenv('DYNARE_LSSI2_KERNEL', 'avx512')
tic;
ynext1 = local_state_space_iteration_2(yhat, epsilon, rf_ghx, rf_ghu, rf_constant, rf_ghxx, rf_ghuu, rf_ghxu, options_.threads.local_state_space_iteration_2);
toc;
disp('kernel=avx2')
setenv('DYNARE_LSSI2_KERNEL', 'avx2')
tic;
ynext2 = local_state_space_iteration_2(yhat, epsilon, rf_ghx, rf_ghu, rf_constant, rf_ghxx, rf_ghuu, rf_ghxu, options_.threads.local_state_space_iteration_2);
toc;
disp('kernel=generic')
setenv('DYNARE_LSSI2_KERNEL', 'generic')
tic;
ynext3 = local_state_space_iteration_2(yhat, epsilon, rf_ghx, rf_ghu, rf_constant, rf_ghxx, rf_ghuu, rf_ghxu, options_.threads.local_state_space_iteration_2);
toc;
if max(max(abs(ynext1-ynext3))) > 1e-15
error('avx512 kernel is inconsistent with generic one')
end
max(max(abs(expected-ynext1)))
*/
if max(max(abs(ynext2-ynext3))) > 1e-15
error('avx2 kernel is inconsistent with generic one')
end
setenv('DYNARE_LSSI2_KERNEL', 'auto')
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment