https://github.com/halide/Halide
Raw File
Tip revision: 928ba6ebaa8f9a7bb5d07ec3775a71723d6d3b5f authored by Steven Johnson on 17 November 2021, 23:17:04 UTC
Merge branch 'master' into shoaibkamil/opengl_compute_tests
Tip revision: 928ba6e
prefetch.cpp
#include "HalideRuntime.h"

extern "C" {

// These need to inline, otherwise the extern call with the ptr
// parameter breaks a lot of optimizations, but needs to be WEAK
// so that Codegen_LLVM can find an instance of the Function to insert.
WEAK_INLINE int _halide_prefetch(const void *ptr) {
    constexpr int rw = 0;        // 1 = write, 0 = read
    constexpr int locality = 0;  // 0 = no temporal locality, 3 = high temporal locality
    __builtin_prefetch(ptr, rw, locality);
    return 0;
}
}
back to top