<commit_before>from __future__ import print_function, division, absolute_import

import gc

import numpy as np

from numba import njit, vectorize
from numba import unittest_support as unittest
from numba import compiler, typing, typeof, ir, utils
from numba.compiler import Pipeline, _PipelineManager, Flags
from numba.targets import cpu
#from .support import MemoryLeakMixin, TestCase


class TestParfors(unittest.TestCase):

    def test_arraymap(self):
        @njit(parallel=True)
        def axy(a, x, y):
            return a * x + y

        A = np.linspace(0,1,10)
        X = np.linspace(2,1,10)
        Y = np.linspace(1,2,10)

        output = axy(A,X,Y)
        expected = A*X+Y
        np.testing.assert_array_equal(expected, output)

    def test_mvdot(self):
        @njit(parallel=True)
        def ddot(a, v):
            return np.dot(a,v)

        A = np.linspace(0,1,20).reshape(2,10)
        v = np.linspace(2,1,10)

        output = ddot(A,v)
        expected = np.dot(A,v)
        np.testing.assert_array_almost_equal(expected, output, decimal=5)

if __name__ == "__main__":
    unittest.main()<commit_msg>test parfor check for do_scheduling in llvm, cleanup<commit_after>from __future__ import print_function, division, absolute_import

import numpy as np

from numba import njit
from numba import unittest_support as unittest


class TestParfors(unittest.TestCase):

    def test_arraymap(self):
        @njit(parallel=True)
        def axy(a, x, y):
            return a * x + y

        A = np.linspace(0,1,10)
        X = np.linspace(2,1,10)
        Y = np.linspace(1,2,10)

        output = axy(A,X,Y)
        expected = A*X+Y
        np.testing.assert_array_equal(expected, output)
        self.assertIn('@do_scheduling', axy.inspect_llvm(axy.signatures[0]))

    def test_mvdot(self):
        @njit(parallel=True)
        def ddot(a, v):
            return np.dot(a,v)

        A = np.linspace(0,1,20).reshape(2,10)
        v = np.linspace(2,1,10)

        output = ddot(A,v)
        expected = np.dot(A,v)
        np.testing.assert_array_almost_equal(expected, output, decimal=5)
        self.assertIn('@do_scheduling', ddot.inspect_llvm(ddot.signatures[0]))

if __name__ == "__main__":
    unittest.main()
{'fraction_non_alphanumeric': 0.11483467381590706, 'fraction_numerical': 0.022341376228775692, 'mean_word_length': 2.833904109589041, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '5973191', 'n_tokens_mistral': 816, 'n_tokens_neox': 792, 'n_words': 172}