Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
KuangjuX committed Feb 13, 2024
1 parent a17d371 commit dc99c9c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 34 deletions.
2 changes: 1 addition & 1 deletion include/access_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace tiledkernel {
step_size(step_size),
offset(offset) {}

std::string map(Platform platform, BufferPtr a, BufferPtr b);
// std::string map(Platform platform, BufferPtr a, BufferPtr b);

size_t loop_depth;
size_t access_dims;
Expand Down
2 changes: 2 additions & 0 deletions include/id.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once
#include <string>
#include <atomic>
#include <optional>

namespace tiledkernel {

Expand Down
1 change: 1 addition & 0 deletions include/tiledbuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "type/data_type.hpp"
#include "mem_level.hpp"
#include <string>
#include <memory>

namespace tiledkernel {
class TiledBuffer {
Expand Down
66 changes: 33 additions & 33 deletions src/access_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,40 @@
#include <fmt/core.h>

namespace tiledkernel {
std::string AccessMap::map(Platform platform, BufferPtr a, BufferPtr b) {
std::string kernel;
std::vector<IterVar> iter_vars;
uint32_t indient = 0;
const std::string ITERNAME[] = {"i", "j", "k", "l", "m", "n"};
if (platform == Platform::Cpu) {
// Generate loop nesting based on `loop_depth`.
for (int i = 0; i < loop_depth; i++) {
// Create a new iterator.
IterVar iter_var =
IterVar(ITERNAME[i], type::DataType::Int32,
iteration_domain[i].first,
iteration_domain[i].second, step_size[i]);
iter_vars.push_back(iter_var);
// std::string AccessMap::map(Platform platform, BufferPtr a, BufferPtr b) {
// std::string kernel;
// std::vector<IterVar> iter_vars;
// uint32_t indient = 0;
// const std::string ITERNAME[] = {"i", "j", "k", "l", "m", "n"};
// if (platform == Platform::Cpu) {
// // Generate loop nesting based on `loop_depth`.
// for (int i = 0; i < loop_depth; i++) {
// // Create a new iterator.
// IterVar iter_var =
// IterVar(ITERNAME[i], type::DataType::Int32,
// iteration_domain[i].first,
// iteration_domain[i].second, step_size[i]);
// iter_vars.push_back(iter_var);

kernel += std::string(indient, ' ');
kernel += iter_var.map();
indient += 4;
}
// Generate load kernel based on `access_pattern`.
kernel += std::string(indient, ' ');
// kernel += std::string(indient, ' ');
// kernel += iter_var.map();
// indient += 4;
// }
// // Generate load kernel based on `access_pattern`.
// kernel += std::string(indient, ' ');

// Close loop parenthesis.
for (int i = 0; i < loop_depth; i++) {
indient -= 4;
kernel += std::string(indient, ' ');
kernel += "}\n";
}
// // Close loop parenthesis.
// for (int i = 0; i < loop_depth; i++) {
// indient -= 4;
// kernel += std::string(indient, ' ');
// kernel += "}\n";
// }

} else if (platform == Platform::Cute) {
// kernel = kernel + load(a, b);
} else if (platform == Platform::Triton) {
// kernel = kernel + load(a, b);
}
return kernel;
}
// } else if (platform == Platform::Cute) {
// // kernel = kernel + load(a, b);
// } else if (platform == Platform::Triton) {
// // kernel = kernel + load(a, b);
// }
// return kernel;
// }
} // namespace tiledkernel

0 comments on commit dc99c9c

Please sign in to comment.