forked from pytorch/pytorch
-
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.
[Specialized Kernel] Propagate Specialized Kernel Support through Com…
…puteCodegenUnboxedKernels (pytorch#103113) Updating ComputeCodegenUnboxedKernels to accept and write out kernel information to RegisterCodegenUnboxedKernels.cpp Differential Revision: [D46486195](https://our.internmc.facebook.com/intern/diff/D46486195/) Pull Request resolved: pytorch#103113 Approved by: https://github.com/larryliu0820, https://github.com/kirklandsign
- Loading branch information
1 parent
e3ee5b0
commit e9674d1
Showing
9 changed files
with
217 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#include <operator_registry.h> | ||
#include "Functions.h" | ||
#include "${fn_header}" // Generated Function import headers | ||
|
||
namespace torch { | ||
namespace executor { | ||
|
||
namespace { | ||
using OpArrayRef = ::at::ArrayRef<::torch::executor::Operator>; | ||
using KernelArrayRef = ::at::ArrayRef<::torch::executor::Kernel>; | ||
|
||
static Operator operators_to_register[] = { | ||
${unboxed_ops} // Generated operators | ||
static Kernel kernels_to_register[] = { | ||
${unboxed_kernels} // Generated operators | ||
}; | ||
|
||
// Explicitly convert to ArrayRef, so that the API can take an empty C array of | ||
// Operators. | ||
static OpArrayRef op_array_ref( | ||
operators_to_register, | ||
operators_to_register + sizeof(operators_to_register) / sizeof(Operator)); | ||
// Kernels. | ||
static KernelArrayRef kernel_array_ref( | ||
kernels_to_register, | ||
kernels_to_register + sizeof(kernels_to_register) / sizeof(Kernel)); | ||
|
||
// Return value not used. Keep the static variable assignment to register | ||
// operators in static initialization time. | ||
static auto success_with_op_reg = register_operators(op_array_ref); | ||
static auto success_with_kernel_reg = register_kernels(kernel_array_ref); | ||
} // namespace | ||
} // namespace executor | ||
} // namespace torch |
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
Oops, something went wrong.