Skip to content

adding compatibility with CUDA < 7.0 #261

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions aksetup_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,10 @@ class BoostLibraries(Libraries):
def __init__(self, lib_base_name, default_lib_name=None):
Copy link
Owner

Choose a reason for hiding this comment

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

Please keep this PR to a single topic (and file a separate PR for installation-related changes, if desired).

Copy link
Author

Choose a reason for hiding this comment

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

Ok, removing changes

if default_lib_name is None:
if lib_base_name == "python":
default_lib_name = "boost_python-py%d%d" % sys.version_info[:2]
default_lib_name = "boost_python%d%d" % sys.version_info[:2]
else:
default_lib_name = "boost_%s" % lib_base_name

default_lib_name = "boost_%s-mt" % lib_base_name
#print(lib_base_name) #python, thread
Libraries.__init__(self, "BOOST_%s" % lib_base_name.upper(),
[default_lib_name],
help="Library names for Boost C++ %s library (without lib or .so)"
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def search_on_path(filenames):


def get_config_schema():
from os import getenv
from aksetup_helper import (
ConfigSchema,
Option,
Expand Down Expand Up @@ -58,9 +59,11 @@ def get_config_schema():
ldflags_default.extend(["/FORCE"])
elif "darwin" in sys.platform:
import glob

root_candidates = glob.glob("/Developer/NVIDIA/CUDA-*")
if root_candidates:
if getenv("CUDA_ROOT"):
cuda_root_default = getenv("CUDA_ROOT")
lib64 = "lib"
else:
cuda_root_default = root_candidates[-1]
lib64 = "lib"

Expand Down
10 changes: 9 additions & 1 deletion src/cpp/cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,9 @@ namespace pycuda

// {{{ device
class context;
#if CUDAPP_CUDA_VERSION >= 7000
class primary_context;

#endif
class device
{
private:
Expand Down Expand Up @@ -829,9 +830,12 @@ namespace pycuda
friend void context_push(boost::shared_ptr<context> ctx);
friend boost::shared_ptr<context>
gl::make_gl_context(device const &dev, unsigned int flags);
#if CUDAPP_CUDA_VERSION >= 7000
friend class primary_context;
#endif
};

#if CUDAPP_CUDA_VERSION >= 7000
class primary_context : public context
{
protected:
Expand All @@ -846,9 +850,13 @@ namespace pycuda
virtual void detach_internal()
{
// Primary context comes from retainPrimaryContext.
// Leo: commenting out
Copy link
Owner

Choose a reason for hiding this comment

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

?

//#if CUDAPP_CUDA_VERSION >= 7000
Copy link
Owner

Choose a reason for hiding this comment

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

Please don't leave commented out code sitting around.

CUDAPP_CALL_GUARDED_CLEANUP(cuDevicePrimaryCtxRelease, (m_device));
//#endif
}
};
#endif

inline
boost::shared_ptr<context> device::make_context(unsigned int flags)
Expand Down