<commit_before>#ifndef _CL_SPARSE_ENVIRONMENT_H_
#define _CL_SPARSE_ENVIRONMENT_H_

#include <gtest/gtest.h>

#include <clSPARSE.h>
#include "opencl_utils.h"



class ClSparseEnvironment : public ::testing::Environment
{
public:

    ClSparseEnvironment()
    {
        // init cl environment
        cl_int status = CL_SUCCESS;
        cl_platform_id* platforms = NULL;
        cl_uint num_platforms = 0;

        status = getPlatforms(&platforms, &num_platforms);
        if (status != CL_SUCCESS)
        {
            std::cerr << "Problem with setting up platforms" << std::endl;
            exit(-1);
        }

        printPlatforms(platforms, num_platforms);

        cl_device_id device = NULL;
        status = getDevice(platforms[0], &device, CL_DEVICE_TYPE_GPU);
        if (status != CL_SUCCESS)
        {
            std::cerr <<"Problem with initializing GPU device" << std::endl;
            exit(-2);
        }

        printDeviceInfo(device);

        cl_context context = clCreateContext(NULL, 1, &device, NULL, NULL, NULL);
        cl_command_queue queue = clCreateCommandQueue(context, device, 0, NULL);

        clsparseSetup();

        control = clsparseCreateControl(queue, NULL);

        free(platforms);
    }


    void SetUp()
    {
    }<commit_msg>bug in creation ctx and queue<commit_after>#ifndef _CL_SPARSE_ENVIRONMENT_H_
#define _CL_SPARSE_ENVIRONMENT_H_

#include <gtest/gtest.h>

#include <clSPARSE.h>
#include "opencl_utils.h"



class ClSparseEnvironment : public ::testing::Environment
{
public:

    ClSparseEnvironment()
    {
        // init cl environment
        cl_int status = CL_SUCCESS;
        cl_platform_id* platforms = NULL;
        cl_uint num_platforms = 0;

        status = getPlatforms(&platforms, &num_platforms);
        if (status != CL_SUCCESS)
        {
            std::cerr << "Problem with setting up platforms" << std::endl;
            exit(-1);
        }

        printPlatforms(platforms, num_platforms);

        cl_device_id device = NULL;
        status = getDevice(platforms[0], &device, CL_DEVICE_TYPE_GPU);
        if (status != CL_SUCCESS)
        {
            std::cerr <<"Problem with initializing GPU device" << std::endl;
            exit(-2);
        }

        printDeviceInfo(device);

        context = clCreateContext(NULL, 1, &device, NULL, NULL, NULL);
        queue = clCreateCommandQueue(context, device, 0, NULL);

        clsparseSetup();

        control = clsparseCreateControl(queue, NULL);

        free(platforms);
    }


    void SetUp()
    {
    }
{'fraction_non_alphanumeric': 0.10736677115987461, 'fraction_numerical': 0.004702194357366771, 'mean_word_length': 2.487704918032787, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3938835', 'n_tokens_mistral': 816, 'n_tokens_neox': 778, 'n_words': 171}