Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/runtime/opencl/opencl_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <vector>

#include "../../support/bytes_io.h"
#include "../source_utils.h"
#include "opencl_common.h"
#include "source_utils.h"

namespace tvm {
namespace runtime {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/opencl/opencl_module_spirv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#include <vector>

#include "../../support/bytes_io.h"
#include "../source_utils.h"
#include "../spirv/spirv_shader.h"
#include "opencl_common.h"
#include "opencl_module.h"
#include "source_utils.h"

namespace tvm {
namespace runtime {
Expand Down
23 changes: 18 additions & 5 deletions src/runtime/source_utils.cc → src/runtime/opencl/source_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,26 @@
*/

/*!
* \file source_utils.cc
* \file source_utils.h
* \brief Minimum source manipulation utils for the OpenCL runtime.
*/
#include "source_utils.h"

#ifndef TVM_RUNTIME_OPENCL_SOURCE_UTILS_H_
#define TVM_RUNTIME_OPENCL_SOURCE_UTILS_H_

#include <string>
#include <unordered_map>

namespace tvm {
namespace runtime {

std::unordered_map<std::string, std::string> SplitKernels(std::string source,
std::string delimiter) {
/*!
* \brief Split the source file on separate kernels by specified delimiter.
* \param source The source code of the kernels.
* \param delimiter The delimiter which is using for splitting kernels.
* \return Mapping from primitive name to kernel source
*/
inline std::unordered_map<std::string, std::string> SplitKernels(
const std::string& source, const std::string& delimiter = "// Function: ") {
std::unordered_map<std::string, std::string> split_kernels;
if (source.size()) {
size_t begin = source.find(delimiter);
Expand All @@ -47,3 +58,5 @@ std::unordered_map<std::string, std::string> SplitKernels(std::string source,
}
} // namespace runtime
} // namespace tvm

#endif // TVM_RUNTIME_OPENCL_SOURCE_UTILS_H_
44 changes: 0 additions & 44 deletions src/runtime/source_utils.h

This file was deleted.

Loading