fix the compile error on mac

revert-15207-remove_op_handle_lock_and_fix_var
tensor-tang 6 years ago
parent 28eb7d840c
commit d538513fce

@ -30,13 +30,13 @@ class GenBase : public Kernel {
virtual const char* name() const = 0;
virtual size_t getSize() const = 0;
virtual const unsigned char* getCodeInternal() = 0;
template <typename FUNC>
const FUNC getCode() {
template <typename Func>
Func getCode() {
const unsigned char* code = this->getCodeInternal();
if (FLAGS_dump_jitcode) {
this->dumpCode(code);
}
return reinterpret_cast<const FUNC>(code);
return reinterpret_cast<Func>(const_cast<unsigned char*>(code));
}
protected:

@ -30,7 +30,7 @@ namespace jit {
template <KernelType KT, typename T, typename Func, typename Attr,
typename PlaceType>
inline const Func GetJitCode(Attr attr) {
inline Func GetJitCode(Attr attr) {
size_t key = JitCodeKey<Attr>(attr);
auto& codes = JitCodePool<KT>().Instance();
if (codes.Has(key)) {
@ -80,7 +80,7 @@ inline Func GetRefer() {
template <KernelType KT, typename T, typename Func, typename Attr,
typename PlaceType = platform::CPUPlace>
const Func Get(Attr attr) {
Func Get(Attr attr) {
auto jitfunc = GetJitCode<KT, T, Func, Attr, PlaceType>(attr);
if (jitfunc) {
return jitfunc;

Loading…
Cancel
Save