Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
STREAMBenchmark-jl
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
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
pc2-CI
Julia
STREAMBenchmark-jl
Commits
13f45f30
Commit
13f45f30
authored
2 years ago
by
Carsten Bauer
Browse files
Options
Downloads
Patches
Plain Diff
minor adjustments
parent
73096c5a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/benchmarks.jl
+1
-10
1 addition, 10 deletions
src/benchmarks.jl
with
1 addition
and
10 deletions
src/benchmarks.jl
+
1
−
10
View file @
13f45f30
...
...
@@ -6,17 +6,8 @@ default_vector_length() = Int(4 * last_cachesize() / sizeof(Float64))
_nthreads_string
(
nthreads
)
=
avxt
()
?
"@avxt"
:
string
(
nthreads
)
function
_threadidcs
(
N
,
nthreads
)
Nperthread
=
div
(
N
,
nthreads
)
rest
=
rem
(
N
,
nthreads
)
Nperthread
,
rest
=
divrem
(
N
,
nthreads
)
thread_indices
=
Vector
{
UnitRange
{
Int64
}}(
undef
,
nthreads
)
#
# more balanced distribution of workload to each thread
#
# For example, 10 elements for 4 threads are distributed as:
# thread 1 has elements 1 to 3 (3 elements per thread)
# thread 2 has elements 4 to 6 (3 elements per thread)
# thread 3 has elements 7 to 8 (2 elements per thread)
# thread 4 has elements 9 to 10 (2 elements per thread)
for
i
in
1
:
nthreads
thread_indices
[
i
]
=
i
≤
rest
?
(((
i
-
1
)
*
(
Nperthread
+
1
)
+
1
)
:
(
i
*
(
Nperthread
+
1
)))
:
...
...
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