def METHOD_NAME(kernel_name, code):
    # workaround for hipRTC
    extra_source = core._get_header_source() if runtime.is_hip else None
    mod = compiler._compile_module_with_cache(
        code, options=('--std=c++11',), extra_source=extra_source)
    return mod.get_function(kernel_name)