diff options
Diffstat (limited to 'compute_kernel_writer')
-rw-r--r-- | compute_kernel_writer/prototype/include/ckw/Kernel.h | 11 | ||||
-rw-r--r-- | compute_kernel_writer/prototype/src/Kernel.cpp | 10 |
2 files changed, 21 insertions, 0 deletions
diff --git a/compute_kernel_writer/prototype/include/ckw/Kernel.h b/compute_kernel_writer/prototype/include/ckw/Kernel.h index 3deb2ace0d..ba31a29ba7 100644 --- a/compute_kernel_writer/prototype/include/ckw/Kernel.h +++ b/compute_kernel_writer/prototype/include/ckw/Kernel.h @@ -50,6 +50,11 @@ class Kernel public: /** Constructor * + * @param[in] language The programming language to write the kernel. + */ + Kernel(GpuTargetLanguage language); + /** Constructor + * * @param[in] name The name of the kernel function. * @param[in] language The programming language to write the kernel. */ @@ -61,6 +66,12 @@ public: /** Get the name of the kernel function. */ const std::string &name() const; + /** Set the name of the kernel function. + * + * @param[in] name The name of the kernel function. + */ + void name(const std::string &name); + /** Get the list of kernel arguments. */ ::std::vector<KernelArgument> arguments() const; diff --git a/compute_kernel_writer/prototype/src/Kernel.cpp b/compute_kernel_writer/prototype/src/Kernel.cpp index 884b69afc6..095ac879f1 100644 --- a/compute_kernel_writer/prototype/src/Kernel.cpp +++ b/compute_kernel_writer/prototype/src/Kernel.cpp @@ -30,11 +30,17 @@ namespace ckw { +Kernel::Kernel(GpuTargetLanguage language) + : Kernel{"unnamed", language} +{ +} + Kernel::Kernel(const char *name, GpuTargetLanguage language) : _name(name), _kernel(std::make_unique<prototype::GpuKernelWriterDataHolder>(language)), _operands{}, _tensor_id_operands{} { } + Kernel::~Kernel() { } @@ -44,6 +50,10 @@ const std::string &Kernel::name() const return _name; } +void Kernel::name(const std::string& name) +{ + _name = name; +} std::vector<KernelArgument> Kernel::arguments() const { std::vector<KernelArgument> arguments; |