Squash SYCL DeviceContext and DeviceStream
[alexxy/gromacs.git] / src / gromacs / gpu_utils / device_context_sycl.cpp
index 06f78f7d20d59799237e69bc9c8c806663a96e2c..7b4f88f31d9c82619f04247a6d1b563adb376801 100644 (file)
  * \brief Implements the DeviceContext for SYCL builds.
  *
  * \author Erik Lindahl <erik.lindahl@gmail.com>
+ * \author Andrey Alekseenko <al42and@gmail.com>
  *
  * \ingroup module_gpu_utils
  */
 #include "gmxpre.h"
 
-#include <vector>
-
-#include <CL/sycl.hpp>
-
 #include "gromacs/gpu_utils/device_context.h"
+#include "gromacs/gpu_utils/gmxsycl.h"
+#include "gromacs/hardware/device_information.h"
 
 
-//! Constructor.
-DeviceContext::DeviceContext(const DeviceInformation& deviceInfo) : deviceInfo_(deviceInfo)
+//! Constructor
+DeviceContext::DeviceContext(const DeviceInformation& deviceInfo) :
+    deviceInfo_(deviceInfo),
+    context_(cl::sycl::context(deviceInfo.syclDevice))
 {
-    // This code is just a meaningless placeholder for now, but to actually test that
-    // compilation with and without SYCL works, and that the correct flags are set, it's
-    // important to have a file that actually contains SYCL code.
-    std::vector<cl::sycl::platform> platforms = cl::sycl::platform::get_platforms();
-    if (platforms.size() > 0)
-    {
-        for (const auto& platform : platforms)
-        {
-            printf("Found SYCL platform %s.\n",
-                   platform.get_info<cl::sycl::info::platform::name>().c_str());
-        }
-    }
 }
 
 //! Destructor