aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-09-16 11:25:35 +0200
committerAnton Khirnov <anton@khirnov.net>2022-09-16 11:27:10 +0200
commit9c32be19bf768706a874aa68d7e90964d1d80f08 (patch)
tree256ac6229adfd7df88c61c8b8f7877ff8d9d1e0c /init.c
parentb43cc61bc85781e384eb183c3818b08421f0b84f (diff)
Remove disabled and pointless OpenCL support.
Diffstat (limited to 'init.c')
-rw-r--r--init.c81
1 files changed, 0 insertions, 81 deletions
diff --git a/init.c b/init.c
index 26b3b27..0370d46 100644
--- a/init.c
+++ b/init.c
@@ -26,11 +26,6 @@
#include <cblas.h>
-#if HAVE_OPENCL
-#include <cl.h>
-#include <clBLAS.h>
-#endif
-
#include <threadpool.h>
#include "basis.h"
@@ -71,63 +66,6 @@ double tdi_scalarproduct_metric_sse3(size_t len1, size_t len2, double *mat,
double tdi_scalarproduct_metric_c(size_t len1, size_t len2, double *mat,
double *vec1, double *vec2);
-static void init_opencl(TDPriv *s)
-#if HAVE_OPENCL
-{
- int err, count;
- cl_platform_id platform;
- cl_context_properties props[3];
- cl_device_id ocl_device;
-
- err = clGetPlatformIDs(1, &platform, &count);
- if (err != CL_SUCCESS || count < 1) {
- tdi_log(&s->logger, 0, "Could not get an OpenCL platform ID\n");
- return;
- }
-
- err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &ocl_device, &count);
- if (err != CL_SUCCESS || count < 1) {
- tdi_log(&s->logger, 0, "Could not get an OpenCL device ID\n");
- return;
- }
-
- props[0] = CL_CONTEXT_PLATFORM;
- props[1] = (cl_context_properties)platform;
- props[2] = 0;
-
- s->ocl_ctx = clCreateContext(props, 1, &ocl_device, NULL, NULL, &err);
- if (err != CL_SUCCESS || !s->ocl_ctx) {
- tdi_log(&s->logger, 0, "Could not create an OpenCL context\n");
- return;
- }
-
- s->ocl_queue = clCreateCommandQueue(s->ocl_ctx, ocl_device, 0, &err);
- if (err != CL_SUCCESS || !s->ocl_queue) {
- tdi_log(&s->logger, 0, "Could not create an OpenCL command queue: %d\n", err);
- goto fail;
- }
-
- err = clblasSetup();
- if (err != CL_SUCCESS) {
- tdi_log(&s->logger, 0, "Error setting up clBLAS\n");
- goto fail;
- }
-
- return;
-fail:
- if (s->ocl_queue)
- clReleaseCommandQueue(s->ocl_queue);
- s->ocl_queue = 0;
-
- if (s->ocl_ctx)
- clReleaseContext(s->ocl_ctx);
- s->ocl_ctx = 0;
-}
-#else
-{
-}
-#endif
-
static const enum BasisFamily basis_sets[NB_EQUATIONS][2] = {
{ BASIS_FAMILY_SB_EVEN, BASIS_FAMILY_COS_EVEN },
{ BASIS_FAMILY_SB_EVEN, BASIS_FAMILY_COS_EVEN },
@@ -157,8 +95,6 @@ static int teukolsky_init_check_options(TDContext *td)
if (ret < 0)
return ret;
- init_opencl(s);
-
s->logger.log = log_callback;
s->logger.opaque = td;
@@ -276,11 +212,6 @@ static int nlsolve_alloc(const TDContext *td, NLSolveContext **pnl)
memcpy(nl->basis, s->basis, sizeof(s->basis));
memcpy(nl->solve_order, s->basis_order, sizeof(s->basis_order));
-#if HAVE_OPENCL
- nl->ocl_ctx = s->ocl_ctx;
- nl->ocl_queue = s->ocl_queue;
-#endif
-
ret = tdi_nlsolve_context_init(nl);
if (ret < 0) {
tdi_log(&s->logger, 0, "Error initializing the non-linear solver\n");
@@ -491,13 +422,6 @@ void td_context_free(TDContext **ptd)
tp_free(&s->tp);
-#if HAVE_OPENCL
- if (s->ocl_queue)
- clReleaseCommandQueue(s->ocl_queue);
- if (s->ocl_ctx)
- clReleaseContext(s->ocl_ctx);
-#endif
-
for (int i = 0; i < ARRAY_ELEMS(s->basis); i++)
for (int j = 0; j < ARRAY_ELEMS(s->basis[i]); j++)
tdi_basis_free(&s->basis[i][j]);
@@ -669,11 +593,6 @@ static int lapse_solve_max(const TDContext *td)
nl->solve_order[0][0] = priv->basis_order[0][0];
nl->solve_order[0][1] = priv->basis_order[0][1];
-#if HAVE_OPENCL
- nl->ocl_ctx = priv->ocl_ctx;
- nl->ocl_queue = priv->ocl_queue;
-#endif
-
ret = tdi_nlsolve_context_init(nl);
if (ret < 0) {
tdi_log(&priv->logger, 0, "Error initializing the non-linear solver\n");