https://github.com/halide/Halide
Raw File
Tip revision: da4d491757093a43131be7ec0e7974d8901ac5ba authored by Steven Johnson on 16 April 2024, 16:42:42 UTC
Merge branch 'main' into abadams/fix_8170
Tip revision: da4d491
CanonicalizeGPUVars.h
#ifndef HALIDE_CANONICALIZE_GPU_VARS_H
#define HALIDE_CANONICALIZE_GPU_VARS_H

/** \file
 * Defines the lowering pass that canonicalize the GPU var names over.
 */

#include "Expr.h"

namespace Halide {
namespace Internal {

/** Canonicalize GPU var names into some pre-determined block/thread names
 * (i.e. __block_id_x, __thread_id_x, etc.). The x/y/z/w order is determined
 * by the nesting order: innermost is assigned to x and so on. */
Stmt canonicalize_gpu_vars(Stmt s);

/** Names for the thread and block id variables. Includes the leading
 * dot. Indexed from inside out, so 0 gives you the innermost loop. */
// @{
const std::string &gpu_thread_name(int index);
const std::string &gpu_block_name(int index);
// @}

}  // namespace Internal
}  // namespace Halide

#endif
back to top