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
Commits
54acf3e2
Commit
54acf3e2
authored
3 weeks ago
by
Russel Arbore
Browse files
Options
Downloads
Patches
Plain Diff
fix gpu backend to emit namespaces properly across cuda versions
parent
94950efe
No related branches found
No related tags found
1 merge request
!216
More optimizations
Pipeline
#202054
passed
3 weeks ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hercules_cg/src/gpu.rs
+20
-6
20 additions, 6 deletions
hercules_cg/src/gpu.rs
with
20 additions
and
6 deletions
hercules_cg/src/gpu.rs
+
20
−
6
View file @
54acf3e2
...
@@ -354,7 +354,6 @@ impl GPUContext<'_> {
...
@@ -354,7 +354,6 @@ impl GPUContext<'_> {
write!
(
write!
(
w
,
w
,
"
"
#define _CG_ABI_EXPERIMENTAL
#include <assert.h>
#include <assert.h>
#include <stdio.h>
#include <stdio.h>
#include <stddef.h>
#include <stddef.h>
...
@@ -362,8 +361,23 @@ impl GPUContext<'_> {
...
@@ -362,8 +361,23 @@ impl GPUContext<'_> {
#include <cuda_runtime.h>
#include <cuda_runtime.h>
#include <math_constants.h>
#include <math_constants.h>
#include <mma.h>
#include <mma.h>
#if (CUDA_VERSION >= 12000)
#else
#define _CG_ABI_EXPERIMENTAL
#endif
#include <cooperative_groups.h>
#include <cooperative_groups.h>
#include <cooperative_groups/reduce.h>
#include <cooperative_groups/reduce.h>
#if (CUDA_VERSION >= 12000)
namespace cg = cooperative_groups;
namespace cge = cooperative_groups;
#else
namespace cg = cooperative_groups;
namespace cge = cooperative_groups::experimental;
#endif
#include <cuda_bf16.h>
#include <cuda_bf16.h>
namespace cg = cooperative_groups;
namespace cg = cooperative_groups;
...
@@ -564,12 +578,12 @@ namespace cg = cooperative_groups;
...
@@ -564,12 +578,12 @@ namespace cg = cooperative_groups;
fn
codegen_helpers
(
&
self
,
w
:
&
mut
String
)
->
Result
<
(),
Error
>
{
fn
codegen_helpers
(
&
self
,
w
:
&
mut
String
)
->
Result
<
(),
Error
>
{
write!
(
write!
(
w
,
w
,
"
\t
__shared__ cg
::experimental
::block_tile_memory<1024> block_sync_shared;
\n
"
"
\t
__shared__ cg
e
::block_tile_memory<1024> block_sync_shared;
\n
"
)
?
;
)
?
;
write!
(
w
,
"
\t
cg::grid_group grid = cg::this_grid();
\n
"
)
?
;
write!
(
w
,
"
\t
cg::grid_group grid = cg::this_grid();
\n
"
)
?
;
write!
(
write!
(
w
,
w
,
"
\t
cg::thread_block block = cg
::experimental
::this_thread_block(block_sync_shared);
\n
"
"
\t
cg::thread_block block = cg
e
::this_thread_block(block_sync_shared);
\n
"
)
?
;
)
?
;
Ok
(())
Ok
(())
}
}
...
@@ -1715,20 +1729,20 @@ namespace cg = cooperative_groups;
...
@@ -1715,20 +1729,20 @@ namespace cg = cooperative_groups;
};
};
write!
(
write!
(
thread_block_tiles
,
thread_block_tiles
,
"
\t
cg::thread_block_tile<{}> {} = cg
::experimental
::tiled_partition<{}>(block);
\n
"
,
"
\t
cg::thread_block_tile<{}> {} = cg
e
::tiled_partition<{}>(block);
\n
"
,
use_thread_per_id
,
cg_tile
,
use_thread_per_id
use_thread_per_id
,
cg_tile
,
use_thread_per_id
)
?
;
)
?
;
let
cg_tile_use
=
self
.get_cg_tile
(
id
,
CGType
::
Use
);
let
cg_tile_use
=
self
.get_cg_tile
(
id
,
CGType
::
Use
);
write!
(
write!
(
thread_block_tiles
,
thread_block_tiles
,
"
\t
cg::thread_block_tile<{}> {} = cg
::experimental
::tiled_partition<{}>(block);
\n
"
,
"
\t
cg::thread_block_tile<{}> {} = cg
e
::tiled_partition<{}>(block);
\n
"
,
use_thread_quota
,
cg_tile_use
,
use_thread_quota
use_thread_quota
,
cg_tile_use
,
use_thread_quota
)
?
;
)
?
;
let
available_thread_quota
=
available_thread_quota
.unwrap
();
let
available_thread_quota
=
available_thread_quota
.unwrap
();
let
cg_tile_available
=
self
.get_cg_tile
(
id
,
CGType
::
Available
);
let
cg_tile_available
=
self
.get_cg_tile
(
id
,
CGType
::
Available
);
write!
(
write!
(
thread_block_tiles
,
thread_block_tiles
,
"
\t
cg::thread_block_tile<{}> {} = cg
::experimental
::tiled_partition<{}>(block);
\n
"
,
"
\t
cg::thread_block_tile<{}> {} = cg
e
::tiled_partition<{}>(block);
\n
"
,
available_thread_quota
,
cg_tile_available
,
available_thread_quota
available_thread_quota
,
cg_tile_available
,
available_thread_quota
)
?
;
)
?
;
if
parallel_factor
.is_none
()
{
if
parallel_factor
.is_none
()
{
...
...
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