Skip to content

Commit

Permalink
Merge pull request #232 from fixstars/fix/warning
Browse files Browse the repository at this point in the history
Fixed minor issue
  • Loading branch information
iitaku authored Jan 30, 2024
2 parents 0645e6f + 113eb54 commit bbd2ea9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 3 additions & 3 deletions include/ion/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class Port {
Halide::Type type;
int32_t dimensions;

std::unordered_map<int32_t, Halide::Internal::Parameter> params;
std::unordered_map<int32_t, const void *> instances;
std::unordered_map<uint32_t, Halide::Internal::Parameter> params;
std::unordered_map<uint32_t, const void *> instances;

Impl();
Impl(const std::string& pid, const std::string& pn, const Halide::Type& t, int32_t d);
Expand Down Expand Up @@ -213,7 +213,7 @@ class Port {
std::vector<const void *> as_instance() const {
std::vector<const void *> instances;
for (const auto& [i, instance] : impl_->instances) {
if (instances.size() <= i) {
if (instances.size() <= static_cast<decltype(instances.size())>(i)) {
instances.resize(i+1, nullptr);
}
instances[i] = instance;
Expand Down
6 changes: 1 addition & 5 deletions src/builder.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#include <algorithm>
#include <fstream>

#ifdef __linux__
#include <unistd.h>
#endif

#include <Halide.h>

#include "ion/builder.h"
Expand Down Expand Up @@ -303,7 +299,7 @@ Halide::Pipeline Builder::build(bool implicit_output) {
bb->bind_input(arginfo.name, fs);
} else {
// access to Port[index]
if (index>=fs.size()){
if (index>=static_cast<decltype(index)>(fs.size())){
throw std::runtime_error("Port index out of range: " + port.pred_name());
}
bb->bind_input(arginfo.name, {fs[index]});
Expand Down

0 comments on commit bbd2ea9

Please sign in to comment.