1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! Original PTX specification:
//!
//! // global -> shared::cluster:
//! cp.async.bulk.prefetch.tensor.dim.L2.src{.load_mode}{.level::cache_hint} [tensorMap, tensorCoords] {, im2colInfo } {, cache-policy};
//! .src = { .global };
//! .dim = { .1d, .2d, .3d, .4d, .5d };
//! .load_mode = { .tile, .tile::gather4, .im2col, .im2col::w, .im2col::w::128 };
//! .level::cache_hint = { .L2::cache_hint };
#![allow(unused)]
use crate::lexer::PtxToken;
use crate::unparser::{PtxUnparser, common::*};
pub mod section_0 {
use super::*;
use crate::r#type::instruction::cp_async_bulk_prefetch_tensor::section_0::*;
impl PtxUnparser for CpAsyncBulkPrefetchTensorDimL2SrcLoadModeLevelCacheHint {
fn unparse_tokens(&self, tokens: &mut ::std::vec::Vec<PtxToken>) {
push_opcode(tokens, "cp");
push_directive(tokens, "async");
push_directive(tokens, "bulk");
push_directive(tokens, "prefetch");
push_directive(tokens, "tensor");
match &self.dim {
Dim::_1d => {
push_directive(tokens, "1d");
}
Dim::_2d => {
push_directive(tokens, "2d");
}
Dim::_3d => {
push_directive(tokens, "3d");
}
Dim::_4d => {
push_directive(tokens, "4d");
}
Dim::_5d => {
push_directive(tokens, "5d");
}
}
push_directive(tokens, "L2");
match &self.src {
Src::Global => {
push_directive(tokens, "global");
}
}
if let Some(load_mode_0) = self.load_mode.as_ref() {
match load_mode_0 {
LoadMode::Im2colW128 => {
push_directive(tokens, "im2col::w::128");
}
LoadMode::TileGather4 => {
push_directive(tokens, "tile::gather4");
}
LoadMode::Im2colW => {
push_directive(tokens, "im2col::w");
}
LoadMode::Im2col => {
push_directive(tokens, "im2col");
}
LoadMode::Tile => {
push_directive(tokens, "tile");
}
}
}
if let Some(level_cache_hint_1) = self.level_cache_hint.as_ref() {
match level_cache_hint_1 {
LevelCacheHint::L2CacheHint => {
push_directive(tokens, "L2::cache_hint");
}
}
}
self.tensormap.unparse_tokens(tokens);
if self.im2colinfo.is_some() { tokens.push(PtxToken::Comma); }
if let Some(opt_2) = self.im2colinfo.as_ref() {
opt_2.unparse_tokens(tokens);
}
if self.cache_policy.is_some() { tokens.push(PtxToken::Comma); }
if let Some(opt_3) = self.cache_policy.as_ref() {
opt_3.unparse_tokens(tokens);
}
tokens.push(PtxToken::Semicolon);
}
}
}