pytorch/torch/csrc/jit/fuser/executor.h
James Reed 6084908287 Code string API for fuser testing (#18884)
Summary:
This adds a C++ function `debugGetFusedKernelCode` as well as a Python binding `_jit_fuser_get_fused_kernel_code` that will, given a FusionGroup graph and a set of specified inputs, return the compiled kernel source code. We can then check the contents of this source code for verification of the fuser codegen backend.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18884

Differential Revision: D14795508

Pulled By: jamesr66a

fbshipit-source-id: 8f6e9dd13ebbb517737d893b0b5f5e9aa06af124
2019-04-05 17:13:17 -07:00

23 lines
548 B
C++

#pragma once
#include <ATen/core/stack.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/jit/fuser/fused_kernel.h>
#include <torch/csrc/jit/fuser/kernel_spec.h>
#include <cstdint>
namespace torch {
namespace jit {
namespace fuser {
// Runs the fusion associated with the key (see registerFusion() in interface.h)
// on the inputs taken from the given Stack.
TORCH_API bool runFusion(
const int64_t key,
Stack& stack,
std::string* code_out = nullptr);
} // namespace fuser
} // namespace jit
} // namespace torch