<commit_before>package org.nd4j.nativeblas;


import org.bytedeco.javacpp.Loader;
import org.bytedeco.javacpp.Pointer;
import org.bytedeco.javacpp.annotation.Platform;


/**
 * Native interface for 
 * op execution on cpu
 * @author <NAME>
 *
 * the preload="libnd4j" is there because MinGW puts a "lib" in front of the filename for the DLL, but at load time,
 * we are using the default Windows platform naming scheme, which doesn't put "lib" in front, so that's a bit of a hack,
 * but easier than forcing MinGW into not renaming the library name -- @saudet on 3/21/16
 */
@Platform(include={"NativeOps.h"}, preload="libnd4j", link = "nd4j")
public class NativeOps extends Pointer {
    static {
        Loader.load();
    }

    public NativeOps() {
        allocate();
        int numThreads = 0;
        String numThreadsString = System.getenv("OMP_NUM_THREADS");
        if(numThreadsString != null && !numThreadsString.isEmpty()) {
            numThreads = Integer.parseInt(numThreadsString);
            setOmpNumThreads(numThreads);
        }
        else
            setOmpNumThreads(Runtime.getRuntime().availableProcessors());
    }
    private native void allocate();


    /**
     *
     * @param opNum
     * @param x<commit_msg>added omp threads<commit_after>package org.nd4j.nativeblas;


import org.bytedeco.javacpp.Loader;
import org.bytedeco.javacpp.Pointer;
import org.bytedeco.javacpp.annotation.Platform;

import org.nd4j.linalg.api.buffer.util.LibUtils;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * Native interface for
 * op execution on cpu
 * @author <NAME>
 *
 * the preload="libnd4j" is there because MinGW puts a "lib" in front of the filename for the DLL, but at load time,
 * we are using the default Windows platform naming scheme, which doesn't put "lib" in front, so that's a bit of a hack,
 * but easier than forcing MinGW into not renaming the library name -- @saudet on 3/21/16
 */
@Platform(include={"NativeOps.h"}, preload="libnd4j", link = "nd4j")
public class NativeOps extends Pointer {
    private static Logger log = LoggerFactory.getLogger(NativeOps.class);
    static {
        Loader.load();
    }

    public NativeOps() {
        allocate();
        int numThreads = 0;
        String numThreadsString = System.getenv("OMP_NUM_THREADS");
        if(numThreadsString != null && !numThreadsString.isEmpty()) {
            numThreads = Integer.parseInt(numThreadsString);
            setOmpNumThreads(numThreads);
        }
        else
            setOmpNumThreads(Runtime.getRuntime().availableProcessors());

    }
    private native void allocate();


    /**
     *
     * @param opNum
     * @param x
{'fraction_non_alphanumeric': 0.10698529411764705, 'fraction_numerical': 0.008823529411764706, 'mean_word_length': 3.141552511415525, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1699824', 'n_tokens_mistral': 869, 'n_tokens_neox': 836, 'n_words': 234}