Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 9bd04d4

Browse files
authored
Merge pull request #584 from nicolasvasilache/pr/namespace
Fixing namespacing issues
2 parents 87a64bb + b596539 commit 9bd04d4

15 files changed

+87
-65
lines changed

tc/core/cuda/cuda_tc_executor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ CudaCompilationResult CudaBackend::compileWithTcMapper(
8686

8787
// Now we can build stuff
8888
auto mappedScop =
89-
polyhedral::MappedScop::makeWithOuterBlockInnerThreadStrategy(
89+
polyhedral::cuda::MappedScop::makeWithOuterBlockInnerThreadStrategy(
9090
std::move(scop), options);
9191
LOG_IF(INFO, FLAGS_debug_tc_mapper) << "Mapped schedule:" << std::endl
9292
<< *(mappedScop->schedule());

tc/core/polyhedral/cpu/mapped_scop.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
namespace tc {
3939
namespace polyhedral {
40+
namespace cpu {
4041

4142
std::unique_ptr<Jit> MappedScop::codegen(
4243
const std::string& specializedName) const {
@@ -89,5 +90,6 @@ std::unique_ptr<MappedScop> MappedScop::makeSequential(
8990
return mappedScop;
9091
}
9192

93+
} // namespace cpu
9294
} // namespace polyhedral
9395
} // namespace tc

tc/core/polyhedral/cpu/mapped_scop.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
namespace tc {
3131
namespace polyhedral {
32+
namespace cpu {
3233

3334
class MappedScop {
3435
private:
@@ -70,5 +71,7 @@ class MappedScop {
7071
public:
7172
const uint64_t unroll;
7273
};
74+
75+
} // namespace cpu
7376
} // namespace polyhedral
7477
} // namespace tc

tc/core/polyhedral/cuda/codegen.cc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@
3131
#include "tc/core/polyhedral/memory_promotion.h"
3232
#include "tc/core/polyhedral/schedule_isl_conversion.h"
3333
#include "tc/core/polyhedral/schedule_transforms.h"
34+
#include "tc/core/polyhedral/scop.h"
3435

3536
using namespace std;
3637

38+
using tc::polyhedral::detail::ScheduleTreeContext;
39+
using tc::polyhedral::detail::ScheduleTreeDomain;
40+
using tc::polyhedral::detail::toIslSchedule;
41+
3742
namespace tc {
3843
namespace polyhedral {
44+
namespace cuda {
3945

4046
namespace {
4147

@@ -612,8 +618,7 @@ void emitHalideExpr(
612618
class EmitHalide : public Halide::Internal::IRPrinter {
613619
using Halide::Internal::IRPrinter::visit;
614620
void visit(const Halide::Internal::Variable* op) {
615-
auto pwAff = tc::polyhedral::detail::makeAffFromMappedExpr(
616-
Halide::Expr(op), context);
621+
auto pwAff = detail::makeAffFromMappedExpr(Halide::Expr(op), context);
617622
auto expr = context.build().expr_from(pwAff);
618623
auto s = expr.to_C_str();
619624
if (!is_identifier_or_nonnegative_integer(expr)) {
@@ -627,8 +632,7 @@ void emitHalideExpr(
627632
} else if (
628633
op->call_type == Halide::Internal::Call::CallType::Halide ||
629634
op->call_type == Halide::Internal::Call::CallType::Image) {
630-
tc::polyhedral::detail::emitMappedTensorAccess(
631-
op->name, op, op->args, context);
635+
detail::emitMappedTensorAccess(op->name, op, op->args, context);
632636
} else if (op->is_intrinsic(tc2halide::kReductionUpdate)) {
633637
op->args[0].accept(this);
634638
} else {
@@ -831,8 +835,8 @@ string emitCudaKernel(
831835
const std::string& specializedName,
832836
const MappedScop& mscop) {
833837
// Expecting a schedule with domain root and context first child.
834-
TC_CHECK(mscop.schedule()->as<detail::ScheduleTreeDomain>());
835-
TC_CHECK(mscop.schedule()->child({0})->as<detail::ScheduleTreeContext>());
838+
TC_CHECK(mscop.schedule()->as<ScheduleTreeDomain>());
839+
TC_CHECK(mscop.schedule()->child({0})->as<ScheduleTreeContext>());
836840
const auto& scop = mscop.scop();
837841

838842
// Make a map of the specialized scalar parameter values
@@ -876,7 +880,7 @@ string emitCudaKernel(
876880
return collectIteratorMaps(n, b, &nodeInfoMap);
877881
};
878882

879-
auto schedule = detail::toIslSchedule(mscop.schedule());
883+
auto schedule = toIslSchedule(mscop.schedule());
880884
auto astBuild = isl::ast_build(schedule.get_ctx());
881885
astBuild = astBuild.set_at_each_domain(collect);
882886
auto root = mscop.schedule();
@@ -890,5 +894,6 @@ string emitCudaKernel(
890894
return ss.str();
891895
}
892896

897+
} // namespace cuda
893898
} // namespace polyhedral
894899
} // namespace tc

tc/core/polyhedral/cuda/codegen.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
namespace tc {
2828
namespace polyhedral {
29+
namespace cuda {
2930

3031
struct CodegenContext;
3132
struct CodegenStatementContext;
@@ -146,5 +147,6 @@ std::string emitCudaKernel(
146147
const std::string& specializedName,
147148
const MappedScop& scop);
148149

150+
} // namespace cuda
149151
} // namespace polyhedral
150152
} // namespace tc

0 commit comments

Comments
 (0)