forked from halide/Halide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request halide#2188 from halide/srj-rungen
Rework RunGetStubs mechanism to be C++-name-mangling-friendly (Take 2)
- Loading branch information
Showing
5 changed files
with
38 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
#ifndef HL_RUNGEN_FILTER | ||
#error "You must define HL_RUNGEN_FILTER" | ||
#endif | ||
#define HALIDE_GET_STANDARD_ARGV_FUNCTION halide_rungen_redirect_argv_getter | ||
#define HALIDE_GET_STANDARD_METADATA_FUNCTION halide_rungen_redirect_metadata_getter | ||
|
||
#define HL_RUNGEN_NAME__(prefix, suffix) prefix##suffix | ||
#define HL_RUNGEN_NAME_(prefix, suffix) HL_RUNGEN_NAME__(prefix, suffix) | ||
#define HL_RUNGEN_NAME(suffix) HL_RUNGEN_NAME_(HL_RUNGEN_FILTER, suffix) | ||
|
||
struct halide_filter_metadata_t; | ||
|
||
extern "C" int HL_RUNGEN_NAME(_argv)(void **args); | ||
extern "C" const struct halide_filter_metadata_t *HL_RUNGEN_NAME(_metadata)(); | ||
// This is legal C, as long as the macro expands to a single quoted (or <>-enclosed) string literal | ||
#include HL_RUNGEN_FILTER_HEADER | ||
|
||
extern "C" int halide_rungen_redirect_argv(void **args) { | ||
return HL_RUNGEN_NAME(_argv)(args); | ||
return halide_rungen_redirect_argv_getter()(args); | ||
} | ||
|
||
extern "C" const struct halide_filter_metadata_t *halide_rungen_redirect_metadata() { | ||
return HL_RUNGEN_NAME(_metadata)(); | ||
return halide_rungen_redirect_metadata_getter()(); | ||
} |