Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
llvm
Hercules
Merge requests
!190
Set up cava benchmark
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Set up cava benchmark
cava_opt_3
into
main
Overview
0
Commits
16
Pipelines
12
Changes
1
Merged
rarbore2
requested to merge
cava_opt_3
into
main
1 month ago
Overview
0
Commits
16
Pipelines
12
Changes
1
Expand
Set up cava benchmark w/ criterion.
GPU schedule for cava.
Convert a bunch of benchmarks from using hercules refs to use hercules boxes.
Define
AlignedAlloc
global allocator in
hercules_rt
that aligns everything to 32 bytes.
Bump nom version.
Edited
1 month ago
by
rarbore2
0
0
Merge request reports
Viewing commit
f7a35a6d
Prev
Next
Show latest version
1 file
+
9
−
25
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
f7a35a6d
use box in dot test
· f7a35a6d
Russel Arbore
authored
1 month ago
hercules_samples/dot/src/main.rs
+
9
−
25
Options
@@ -2,36 +2,20 @@
#[cfg(feature
=
"cuda"
)]
use
hercules_rt
::
CUDABox
;
use
hercules_rt
::{
runner
,
Hercules
CPURef
};
use
hercules_rt
::{
runner
,
Hercules
ImmBox
,
HerculesImmBoxTo
};
juno_build
::
juno!
(
"dot"
);
fn
main
()
{
async_std
::
task
::
block_on
(
async
{
#[cfg(not(feature
=
"cuda"
))]
{
let
a
:
[
f32
;
8
]
=
[
0.0
,
1.0
,
0.0
,
2.0
,
0.0
,
3.0
,
0.0
,
4.0
];
let
a
=
HerculesCPURef
::
from_slice
(
&
a
);
let
b
:
[
f32
;
8
]
=
[
0.0
,
5.0
,
0.0
,
6.0
,
0.0
,
7.0
,
0.0
,
8.0
];
let
b
=
HerculesCPURef
::
from_slice
(
&
b
);
let
mut
r
=
runner!
(
dot
);
let
c
=
r
.run
(
8
,
a
,
b
)
.await
;
println!
(
"{}"
,
c
);
assert_eq!
(
c
,
70.0
);
}
#[cfg(feature
=
"cuda"
)]
{
let
mut
a
:
[
f32
;
8
]
=
[
0.0
,
1.0
,
0.0
,
2.0
,
0.0
,
3.0
,
0.0
,
4.0
];
let
a_box
=
CUDABox
::
from_cpu_ref
(
HerculesCPURef
::
from_slice
(
&
mut
a
));
let
a
=
a_box
.get_ref
();
let
mut
b
:
[
f32
;
8
]
=
[
0.0
,
5.0
,
0.0
,
6.0
,
0.0
,
7.0
,
0.0
,
8.0
];
let
b_box
=
CUDABox
::
from_cpu_ref
(
HerculesCPURef
::
from_slice
(
&
mut
b
));
let
b
=
b_box
.get_ref
();
let
mut
r
=
runner!
(
dot
);
let
c
=
r
.run
(
8
,
a
,
b
)
.await
;
println!
(
"{}"
,
c
);
assert_eq!
(
c
,
70.0
);
}
let
a
:
[
f32
;
8
]
=
[
0.0
,
1.0
,
0.0
,
2.0
,
0.0
,
3.0
,
0.0
,
4.0
];
let
b
:
[
f32
;
8
]
=
[
0.0
,
5.0
,
0.0
,
6.0
,
0.0
,
7.0
,
0.0
,
8.0
];
let
a
=
HerculesImmBox
::
from
(
&
a
as
&
[
f32
]);
let
b
=
HerculesImmBox
::
from
(
&
b
as
&
[
f32
]);
let
mut
r
=
runner!
(
dot
);
let
c
=
r
.run
(
8
,
a
.to
(),
b
.to
())
.await
;
println!
(
"{}"
,
c
);
assert_eq!
(
c
,
70.0
);
});
}
Loading