Skip to content

Commit 780cb9c

Browse files
committed
small chagnes
1 parent 1ba59dd commit 780cb9c

File tree

5 files changed

+23
-76
lines changed

5 files changed

+23
-76
lines changed

sycl/include/CL/sycl/detail/pi.hpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <cassert>
2222
#include <cstdint>
2323
#include <memory>
24-
#include <sstream>
24+
//#include <sstream>
2525
#include <string>
2626
#include <vector>
2727

@@ -82,11 +82,14 @@ __SYCL_EXPORT void assertion(bool Condition, const char *Message = nullptr);
8282

8383
template <typename T>
8484
void handleUnknownParamName(const char *functionName, T parameter) {
85-
std::stringstream stream;
86-
stream << "Unknown parameter " << parameter << " passed to " << functionName
87-
<< "\n";
88-
auto str = stream.str();
89-
auto msg = str.c_str();
85+
std::string string;
86+
string+= "Unknown parameter ";
87+
string+= parameter;
88+
string+=" passed to ";
89+
string+=functionName;
90+
string+= "\n";
91+
auto str = string.c_str();
92+
auto msg = string.c_str();
9093
die(msg);
9194
}
9295

sycl/include/CL/sycl/half_type.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -587,18 +587,18 @@ class half {
587587
}
588588

589589
// Operator << and >>
590-
inline friend std::ostream &operator<<(std::ostream &O,
591-
cl::sycl::half const &rhs) {
592-
O << static_cast<float>(rhs);
593-
return O;
594-
}
595-
596-
inline friend std::istream &operator>>(std::istream &I, cl::sycl::half &rhs) {
597-
float ValFloat = 0.0f;
598-
I >> ValFloat;
599-
rhs = ValFloat;
600-
return I;
601-
}
590+
// inline friend std::ostream &operator<<(std::ostream &O,
591+
// cl::sycl::half const &rhs) {
592+
// O << static_cast<float>(rhs);
593+
// return O;
594+
// }
595+
596+
// inline friend std::istream &operator>>(std::istream &I, cl::sycl::half &rhs) {
597+
// float ValFloat = 0.0f;
598+
// I >> ValFloat;
599+
// rhs = ValFloat;
600+
// return I;
601+
// }
602602

603603
template <typename Key> friend struct std::hash;
604604

sycl/include/sycl/sycl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
#pragma once
1010

11-
#include <CL/sycl.hpp>
11+
#include <CL/sycl.hpp>

sycl/source/detail/config.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <mutex>
2222
#include <string>
2323
#include <utility>
24+
#include <iostream>
2425

2526
__SYCL_INLINE_NAMESPACE(cl) {
2627
namespace sycl {

sycl/source/detail/persistent_device_code_cache.cpp

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -348,63 +348,6 @@ std::string PersistentDeviceCodeCache::getCacheItemPath(
348348
}
349349

350350

351-
// TODO Currently parsing configuration variables and error reporting is not
352-
// centralized, and is basically re-implemented (with different level of
353-
// reliability) for each particular variable. As a variant, this can go into
354-
// the SYCLConfigBase class, which can be templated by value type, default value
355-
// and value parser (combined with error checker). It can also have typed get()
356-
// function returning one-time parsed and error-checked value.
357-
358-
// Parses persistent cache configuration and checks it for errors.
359-
// Returns true if it is enabled, false otherwise.
360-
static bool parsePersistentCacheConfig() {
361-
constexpr bool Default = false; // default is disabled
362-
363-
// Check if deprecated opt-out env var is used, then warn.
364-
if (SYCLConfig<SYCL_CACHE_DISABLE_PERSISTENT>::get()) {
365-
fprintf(stderr,
366-
"WARNING: %s%s%s%s%s%s",SYCLConfig<SYCL_CACHE_DISABLE_PERSISTENT>::getName(),
367-
"and has no effect. By default, persistent device code caching is ",
368-
(Default ? "enabled." : "disabled."), " Use ",
369-
SYCLConfig<SYCL_CACHE_PERSISTENT>::getName(),
370-
"=1/0 to enable/disable.\n");
371-
}
372-
bool Ret = Default;
373-
const char *RawVal = SYCLConfig<SYCL_CACHE_PERSISTENT>::get();
374-
375-
if (RawVal) {
376-
if (!std::strcmp(RawVal, "0")) {
377-
Ret = false;
378-
} else if (!std::strcmp(RawVal, "1")) {
379-
Ret = true;
380-
} else {
381-
std::string Msg =
382-
std::string{"Invalid value for bool configuration variable "} +
383-
SYCLConfig<SYCL_CACHE_PERSISTENT>::getName() + std::string{": "} +
384-
RawVal;
385-
throw runtime_error(Msg, PI_INVALID_OPERATION);
386-
}
387-
}
388-
PersistentDeviceCodeCache::trace(Ret ? "enabled" : "disabled");
389-
return Ret;
390-
}
391-
392-
/* Cached static variable signalling if the persistent cache is enabled.
393-
* The variable can have three values:
394-
* - None : The configuration has not been parsed.
395-
* - true : The persistent cache is enabled.
396-
* - false : The persistent cache is disabled.
397-
*/
398-
static std::optional<bool> CacheIsEnabled;
399-
400-
/* Forces a reparsing of the information used to determine if the persistent
401-
* cache is enabled. This is primarily used for unit-testing where the
402-
* corresponding configuration variable is set by the individual tests.
403-
*/
404-
void PersistentDeviceCodeCache::reparseConfig() {
405-
CacheIsEnabled = parsePersistentCacheConfig();
406-
}
407-
408351

409352
/* Returns true if persistent cache is enabled.
410353
*/

0 commit comments

Comments
 (0)