[CODEGEN/DRIVER] Tweaks for performance optimization (#193)
This commit is contained in:
@@ -98,6 +98,7 @@ struct dispatch{
|
||||
|
||||
// internal (debug/optimization)
|
||||
static ir::value *multiple_of(ir::value *x, int value, ir::builder *builder);
|
||||
static ir::value *max_contiguous(ir::value *x, int value, ir::builder *builder);
|
||||
static ir::value *debug_barrier(ir::builder *builder);
|
||||
};
|
||||
|
||||
|
@@ -11,7 +11,8 @@ namespace ir{
|
||||
class metadata{
|
||||
public:
|
||||
enum kind_t{
|
||||
multiple_of
|
||||
multiple_of,
|
||||
max_contiguous
|
||||
};
|
||||
|
||||
private:
|
||||
|
37
include/triton/tools/sys/exec.hpp
Normal file
37
include/triton/tools/sys/exec.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef TRITON_TOOLS_SYS_EXEC_HPP
|
||||
#define TRITON_TOOLS_SYS_EXEC_HPP
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace triton
|
||||
{
|
||||
namespace tools
|
||||
{
|
||||
|
||||
|
||||
|
||||
int exec(const std::string& cmd, std::string& result) {
|
||||
char buffer[128];
|
||||
FILE* pipe = popen(cmd.c_str(), "r");
|
||||
if (!pipe)
|
||||
return 0;
|
||||
result.clear();
|
||||
try {
|
||||
while (fgets(buffer, sizeof buffer, pipe) != NULL)
|
||||
result += buffer;
|
||||
} catch (...) {
|
||||
pclose(pipe);
|
||||
return 0;
|
||||
}
|
||||
return WEXITSTATUS(pclose(pipe));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user