Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit a43ee7b

Browse files
committed
Merge pull request #23 from thrust/integrate-various-fixes
Integrate various fixes
2 parents 39449f8 + 563c026 commit a43ee7b

File tree

6 files changed

+26
-9
lines changed

6 files changed

+26
-9
lines changed

SConstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ elif master_env['PLATFORM'] == 'darwin':
343343
master_env['ENV'].setdefault('DYLD_LIBRARY_PATH', []).append(cuda_installation()[1])
344344
elif master_env['PLATFORM'] == 'win32':
345345
master_env['ENV']['TBBROOT'] = os.environ['TBBROOT']
346+
master_env['ENV']['PATH'] += ';' + tbb_installation(master_env)[0]
346347

347348
# get the list of requested backends
348349
host_backends = master_env.subst('$host_backend').split()

testing/backend/cuda/testframework.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,9 @@ bool CUDATestDriver::run_tests(const ArgumentSet &args, const ArgumentMap &kwarg
160160
return result;
161161
}
162162

163+
UnitTestDriver &driver_instance(thrust::system::cuda::tag)
164+
{
165+
static CUDATestDriver s_instance;
166+
return s_instance;
167+
}
168+

testing/backend/cuda/testframework.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ class CUDATestDriver
1616
virtual bool run_tests(const ArgumentSet &args, const ArgumentMap &kwargs);
1717
};
1818

19+
UnitTestDriver &driver_instance(thrust::system::cuda::tag);
20+

testing/testframework.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,8 @@ UnitTestDriver &driver_instance(DeviceSystem tag)
423423
return s_instance;
424424
}
425425

426-
// overload driver_instance, if we need a special kind of
427-
// UnitTestDriver
428-
429-
UnitTestDriver &driver_instance(thrust::system::cuda::tag)
430-
{
431-
static CUDATestDriver s_instance;
432-
return s_instance;
433-
}
426+
// if we need a special kind of UnitTestDriver, overload
427+
// driver_instance in that function
434428

435429
UnitTestDriver &
436430
UnitTestDriver::s_driver()

testing/unittest/testframework.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ class UnitTestDriver
135135
// \return true if all is well; false if the tests must be immediately aborted
136136
virtual bool post_test_sanity_check(const UnitTest &test, bool concise);
137137

138+
public:
138139
inline virtual ~UnitTestDriver() {};
139140

140-
public:
141141
void register_test(UnitTest * test);
142142
virtual bool run_tests(const ArgumentSet& args, const ArgumentMap& kwargs);
143143
void list_tests(void);

thrust/system/cuda/detail/tag.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,34 @@ inline Tag select_system(thrust::any_system_tag, Tag)
5757
return Tag();
5858
}
5959

60+
// this version catches a user's tag derived from cuda::tag in the first slot
6061
template<typename Tag>
6162
__host__ __device__
6263
inline cuda_to_cpp select_system(Tag, thrust::system::cpp::tag)
6364
{
6465
return cuda_to_cpp();
6566
}
6667

68+
__host__ __device__
69+
inline cuda_to_cpp select_system(tag, thrust::system::cpp::tag)
70+
{
71+
return cuda_to_cpp();
72+
}
73+
74+
// this version catches a user's tag derived from cuda::tag in the second slot
6775
template<typename Tag>
6876
__host__ __device__
6977
inline cpp_to_cuda select_system(thrust::system::cpp::tag, Tag)
7078
{
7179
return cpp_to_cuda();
7280
}
7381

82+
__host__ __device__
83+
inline cpp_to_cuda select_system(thrust::system::cpp::tag, tag)
84+
{
85+
return cpp_to_cuda();
86+
}
87+
7488
} // end detail
7589

7690
// alias the tag here

0 commit comments

Comments
 (0)