Skip to content

Commit bf24b22

Browse files
Removed pre-preprocessor fenced out dead code
Renamed backend_sycl_singleton back to backend_sycl Removed dpnp_queue_initialize_c function and QueueOptions enum as no longer used. Removed uses of these from examples and code base
1 parent 814ad56 commit bf24b22

File tree

13 files changed

+43
-194
lines changed

13 files changed

+43
-194
lines changed

dpnp/backend/examples/example10.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ void test_dpnp_random_normal(const size_t size,
5050
double dev_time_used = 0.0;
5151
double sum_dev_time_used = 0.0;
5252

53-
dpnp_queue_initialize_c(QueueOptions::GPU_SELECTOR);
54-
5553
double *result = (double *)dpnp_memory_alloc_c(size * sizeof(double));
5654

5755
dpnp_rng_srand_c(seed); // TODO: will move

dpnp/backend/examples/example3.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ int main(int, char **)
4444
{
4545
const size_t size = 256;
4646

47-
dpnp_queue_initialize_c();
4847
std::cout << "SYCL queue is CPU: " << dpnp_queue_is_cpu_c() << std::endl;
4948

5049
int *array1 = (int *)dpnp_memory_alloc_c(size * sizeof(int));

dpnp/backend/examples/example5.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ int main(int, char **)
5252
{
5353
const size_t size = 256;
5454

55-
dpnp_queue_initialize_c(QueueOptions::CPU_SELECTOR);
56-
5755
double *result = (double *)dpnp_memory_alloc_c(size * sizeof(double));
5856

5957
size_t seed = 10;

dpnp/backend/examples/example7.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ int main(int, char **)
4545
const size_t size = 2;
4646
size_t len = size * size;
4747

48-
dpnp_queue_initialize_c(QueueOptions::CPU_SELECTOR);
49-
5048
float *array = (float *)dpnp_memory_alloc_c(len * sizeof(float));
5149
float *result1 = (float *)dpnp_memory_alloc_c(size * sizeof(float));
5250
float *result2 = (float *)dpnp_memory_alloc_c(len * sizeof(float));

dpnp/backend/examples/example8.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ int main(int, char **)
4242
{
4343
const size_t size = 16;
4444

45-
dpnp_queue_initialize_c(QueueOptions::GPU_SELECTOR);
46-
4745
double *array = (double *)dpnp_memory_alloc_c(size * sizeof(double));
4846
long *result = (long *)dpnp_memory_alloc_c(size * sizeof(long));
4947

dpnp/backend/examples/example9.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ int main(int, char **)
4646
long result = 0;
4747
long result_verification = 0;
4848

49-
dpnp_queue_initialize_c(QueueOptions::CPU_SELECTOR);
50-
5149
long *array =
5250
reinterpret_cast<long *>(dpnp_memory_alloc_c(size * sizeof(long)));
5351

dpnp/backend/examples/example_bs.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ int main(int, char **)
229229
const double RISK_FREE = 0.1;
230230
const double VOLATILITY = 0.2;
231231

232-
dpnp_queue_initialize_c(QueueOptions::GPU_SELECTOR);
233232
std::cout << "SYCL queue is CPU: " << dpnp_queue_is_cpu_c() << std::endl;
234233

235234
double *price = (double *)dpnp_memory_alloc_c(SIZE * sizeof(double));

dpnp/backend/include/dpnp_iface.hpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,6 @@ typedef ssize_t shape_elem_type;
6868
* @}
6969
*/
7070

71-
/**
72-
* @ingroup BACKEND_API
73-
* @brief SYCL queue initialization selector.
74-
*
75-
* The structure defines the parameters that are used for the library
76-
* initialization by @ref dpnp_queue_initialize_c "dpnp_queue_initialize".
77-
*/
78-
enum class QueueOptions : uint32_t
79-
{
80-
CPU_SELECTOR, /**< CPU side execution mode */
81-
GPU_SELECTOR, /**< Intel GPU side execution mode */
82-
AUTO_SELECTOR /**< Automatic selection based on environment variable with
83-
@ref CPU_SELECTOR default */
84-
};
85-
86-
/**
87-
* @ingroup BACKEND_API
88-
* @brief SYCL queue initialization.
89-
*
90-
* Global SYCL queue initialization.
91-
*
92-
* @param [in] selector Select type @ref QueueOptions of the SYCL queue.
93-
* Default @ref AUTO_SELECTOR
94-
*/
95-
INP_DLLEXPORT void dpnp_queue_initialize_c(
96-
QueueOptions selector = QueueOptions::AUTO_SELECTOR);
9771

9872
/**
9973
* @ingroup BACKEND_API
@@ -112,8 +86,7 @@ INP_DLLEXPORT size_t dpnp_queue_is_cpu_c();
11286
* @param [in] size_in_bytes Number of bytes for requested memory allocation.
11387
* @param [in] q_ref Reference to SYCL queue.
11488
*
115-
* @return A pointer to newly created memory on @ref dpnp_queue_initialize_c
116-
* "initialized SYCL device".
89+
* @return A pointer to newly created memory on SYCL device.
11790
*/
11891
INP_DLLEXPORT char *dpnp_memory_alloc_c(DPCTLSyclQueueRef q_ref,
11992
size_t size_in_bytes);

dpnp/backend/kernels/dpnp_krnl_random.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static VSLStreamStatePtr get_rng_stream()
7070

7171
void dpnp_rng_srand_c(size_t seed)
7272
{
73-
auto &be = backend_sycl_singleton::get();
73+
auto &be = backend_sycl::get();
7474
be.set_rng_engines_seed(seed);
7575
set_rng_stream(seed);
7676
}

dpnp/backend/src/queue_sycl.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,8 @@ static long dpnp_kernels_link()
111111
}
112112
#endif
113113

114-
void dpnp_queue_initialize_c(QueueOptions)
115-
{
116-
[[maybe_unused]] auto &be = backend_sycl_singleton::get();
117-
}
118-
119114
size_t dpnp_queue_is_cpu_c()
120115
{
121-
const auto &be = backend_sycl_singleton::get();
116+
const auto &be = backend_sycl::get();
122117
return be.backend_sycl_is_cpu();
123118
}

0 commit comments

Comments
 (0)