Skip to content

Commit 425e196

Browse files
committed
Merge pull request #614 from izaid/option
Updates to match libdynd
2 parents 464e3bc + 537eb06 commit 425e196

File tree

3 files changed

+5
-42
lines changed

3 files changed

+5
-42
lines changed

CMakeLists.txt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ list(APPEND CMAKE_MODULE_PATH
3434
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
3535
include(GetGitRevisionDescriptionDyND)
3636

37-
find_package(CUDA 6.5)
3837
find_package(PythonInterp REQUIRED)
3938
find_package(PythonLibsNew REQUIRED)
4039
find_package(NumPy REQUIRED)
@@ -55,22 +54,10 @@ endif()
5554

5655
if (DYND_INSTALL_LIB)
5756
find_package(LibDyND REQUIRED)
58-
if(LIBDYND_CUDA)
59-
option(DYND_CUDA
60-
"Use a libdynd built with CUDA. If DYND_INSTALL_LIB is ON, this defaults to the DYND_CUDA option used when building libdynd. Otherwise it defaults to OFF."
61-
ON)
62-
else()
63-
option(DYND_CUDA
64-
"Use a libdynd built with CUDA. If DYND_INSTALL_LIB is ON, this defaults to the DYND_CUDA option used when building libdynd. Otherwise it defaults to OFF."
65-
OFF)
66-
endif()
6757
else()
6858
set(DYND_SHARED_LIB ON)
6959
# USE_RELATIVE_RPATH is inherited from this cmakelists, so need to set it here
7060
option(DYND_BUILD_TESTS "Build the googletest unit tests for libdynd." ON)
71-
option(DYND_CUDA
72-
"Use a libdynd built with CUDA. If DYND_INSTALL_LIB is ON, this defaults to the DYND_CUDA option used building that library. Otherwise it defaults to OFF."
73-
OFF)
7461

7562
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/libraries/libdynd/include/dynd/array.hpp")
7663
message(FATAL_ERROR
@@ -156,14 +143,6 @@ include_directories(
156143
${CMAKE_CURRENT_BINARY_DIR}
157144
)
158145

159-
if(DYND_CUDA)
160-
include_directories(${CUDA_INCLUDE_DIRS})
161-
add_definitions(-DDYND_CUDA)
162-
set(DYND_CUDA_01 1)
163-
else()
164-
set(DYND_CUDA_01 0)
165-
endif()
166-
167146
foreach(pyx_api_file dynd/nd/array.pyx dynd/nd/callable.pyx dynd/ndt/type.pyx)
168147
set_source_files_properties(${pyx_api_file} PROPERTIES CYTHON_API 1)
169148
set_source_files_properties(${pyx_api_file} PROPERTIES CYTHON_PUBLIC 1)

cmake/FindLibDyND.cmake

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
# distribute, sublicense, and/or sell copies of the Software, and to permit
2121
# persons to whom the Software is furnished to do so, subject to
2222
# the following conditions:
23-
#
23+
#
2424
# The above copyright notice and this permission notice shall be included
2525
# in all copies or substantial portions of the Software.
26-
#
26+
#
2727
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2828
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2929
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
3030
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
3131
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3232
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3333
# OTHER DEALINGS IN THE SOFTWARE.
34-
#
34+
#
3535
#============================================================================
3636

3737
# Try to find a libdynd-config program
@@ -90,24 +90,8 @@ if(NOT _DYND_SEARCH_SUCCESS MATCHES 0)
9090
"Error getting additional properties of libdynd:\n${_DYND_ERROR_VALUE}")
9191
endif()
9292

93-
# Get whether or not libdynd was built with cuda support
94-
execute_process(COMMAND "${_LIBDYND_CONFIG}" "-cuda"
95-
RESULT_VARIABLE _DYND_SEARCH_SUCCESS
96-
OUTPUT_VARIABLE LIBDYND_CUDA
97-
ERROR_VARIABLE _DYND_ERROR_VALUE
98-
OUTPUT_STRIP_TRAILING_WHITESPACE)
99-
if(NOT _DYND_SEARCH_SUCCESS MATCHES 0)
100-
message(FATAL_ERROR
101-
"Error getting additional properties of libdynd:\n${_DYND_ERROR_VALUE}")
102-
endif()
103-
# Verify that the value in LIBDYND_CUDA is either "ON" or "OFF"
104-
if(NOT ("${LIBDYND_CUDA}" STREQUAL "ON" OR "${LIBDYND_CUDA}" STREQUAL "OFF"))
105-
message(FATAL_ERROR "Unrecognized cuda option returned from libdynd-config.")
106-
endif()
107-
10893
find_package_message(LIBDYND
10994
"Found LibDyND: version \"${LIBDYND_VERSION}\", ${LIBDYND_LIBRARIES}"
11095
"${LIBDYND_INCLUDE_DIRS}${LIBDYND_LIBRARIES}${LIBDYND_VERSION}")
11196

11297
set(NUMPY_FOUND TRUE)
113-

dynd/src/array_from_py.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <dynd/types/substitute_shape.hpp>
1919
#include <dynd/types/type_type.hpp>
2020
#include <dynd/types/var_dim_type.hpp>
21+
#include <dynd/option.hpp>
2122

2223
#include "array_from_py.hpp"
2324
#include "array_from_py_typededuction.hpp"
@@ -183,8 +184,7 @@ inline void convert_one_pyscalar_option(const ndt::type &tp,
183184
PyObject *obj)
184185
{
185186
if (obj == Py_None) {
186-
tp.extended<ndt::option_type>()->assign_na(arrmeta, out,
187-
&eval::default_eval_context);
187+
nd::old_assign_na(tp, arrmeta, out);
188188
}
189189
else {
190190
throw std::runtime_error("unable to convert to option value");

0 commit comments

Comments
 (0)