Skip to content

Refactor imports #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dppl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
'''
__author__ = "Intel Corp."

from ._version import get_versions
from ._oneapi_interface import *
from ._version import get_versions

__version__ = get_versions()['version']
del get_versions
6 changes: 3 additions & 3 deletions dppl/driverapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
### functions.
##===----------------------------------------------------------------------===##

from cffi import FFI
import os
import sys
from distutils import sysconfig

from cffi import FFI


ffi = FFI()

Expand Down
8 changes: 5 additions & 3 deletions dppl/ocldrv.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@

from __future__ import absolute_import, division, print_function

from ._dppl_bindings import ffi, lib
from numpy import ndarray
from contextlib import contextmanager
import ctypes

import logging

from numpy import ndarray

from ._dppl_bindings import ffi, lib


__author__ = "Intel Corp."

_logger = logging.getLogger(__name__)
Expand Down
8 changes: 5 additions & 3 deletions dppl/tests/test_dump_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
# limitations under the License.
#******************************************************************************/

import unittest
import dppl
import dppl.ocldrv as drv
from contextlib import contextmanager
import ctypes
import dppl
import io
import os, sys
import tempfile
import unittest

import dppl.ocldrv as drv


libc = ctypes.CDLL(None)
c_stdout = ctypes.c_void_p.in_dll(libc, 'stdout')
Expand Down
2 changes: 2 additions & 0 deletions examples/create_sycl_queues.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import print_function

from dppl import runtime, device_context, device_type


# Global runtime object inside dppl
rt = runtime

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_for_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ conda_build_ret -ne 0 ]]; then
esac
fi

export ONEAPI_ROOT="/opt/intel/inteloneapi"
export ONEAPI_ROOT="/opt/intel/oneapi"

conda build --output-folder ${CONDA_PKG_DIR} ${CHANNELS} conda-recipe

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_for_develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mkdir build_cmake
pushd build_cmake

INSTALL_PREFIX=`pwd`/../install
export ONEAPI_ROOT=/opt/intel/inteloneapi
export ONEAPI_ROOT=/opt/intel/oneapi
DPCPP_ROOT=${ONEAPI_ROOT}/compiler/latest/linux
PYTHON_INC=`python -c "import distutils.sysconfig; \
print(distutils.sysconfig.get_python_inc())"`
Expand Down
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@
### \file
### This file builds the dppl and dppl.ocldrv extension modules.
##===----------------------------------------------------------------------===##
import sys
import numpy as np
import os
import sys
import versioneer
from setuptools import setup, Extension

from Cython.Build import cythonize
from setuptools import setup, Extension
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not catch this. setuptools should be imported before Cython.


import numpy as np


requirements = [
'cffi>=1.0.0',
Expand Down