Skip to content

Commit

Permalink
[SYCL][Fusion][NoSTL] Use sycl::detail::string in interface (#13701)
Browse files Browse the repository at this point in the history
Replace `jit_compiler::DynString` uses with `sycl::detail::string`.

Signed-off-by: Victor Perez <victor.perez@codeplay.com>
  • Loading branch information
victor-eds authored May 9, 2024
1 parent bc18ad1 commit b6a6f53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
19 changes: 0 additions & 19 deletions sycl-fusion/common/include/DynArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define SYCL_FUSION_COMMON_DYNARRAY_H

#include <algorithm>
#include <cstring>

namespace jit_compiler {

Expand Down Expand Up @@ -93,24 +92,6 @@ template <typename T> class DynArray {
}
};

///
/// String-like class that owns its character storage.
class DynString {
public:
explicit DynString(const char *Str = "") : Chars{std::strlen(Str) + 1} {
std::copy(Str, Str + Chars.size(), Chars.begin());
}

const char *c_str() const { return Chars.begin(); }

friend bool operator==(const DynString &A, const char *B) {
return std::strcmp(A.c_str(), B) == 0;
}

private:
DynArray<char> Chars;
};

} // namespace jit_compiler

#endif // SYCL_FUSION_COMMON_DYNARRAY_H
3 changes: 2 additions & 1 deletion sycl-fusion/common/include/Kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define SYCL_FUSION_COMMON_KERNEL_H

#include "DynArray.h"
#include "sycl/detail/string.hpp"

#include <algorithm>
#include <cassert>
Expand Down Expand Up @@ -327,7 +328,7 @@ class NDRange {
/// Information about a kernel from DPC++.
struct SYCLKernelInfo {

DynString Name;
sycl::detail::string Name;

SYCLArgumentDescriptor Args;

Expand Down
4 changes: 2 additions & 2 deletions sycl-fusion/jit-compiler/include/KernelFusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#ifndef SYCL_FUSION_JIT_COMPILER_KERNELFUSION_H
#define SYCL_FUSION_JIT_COMPILER_KERNELFUSION_H

#include "DynArray.h"
#include "Kernel.h"
#include "Options.h"
#include "Parameter.h"
#include "View.h"
#include "sycl/detail/string.hpp"

#include <cassert>

Expand Down Expand Up @@ -48,7 +48,7 @@ class FusionResult {

FusionResultType Type;
SYCLKernelInfo KernelInfo;
DynString ErrorMessage;
sycl::detail::string ErrorMessage;
};

extern "C" {
Expand Down

0 comments on commit b6a6f53

Please sign in to comment.