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

Commit 2d2c999

Browse files
committed
Replace the term "sanity", which is non-inclusive.
"sanity", which has denotative (e.g. primary) meaning of "basic tests", also has negative connotations (e.g. secondary meanings) relating to mental health. The use of the term "sanity check" may suggest that individuals with mental illnesses are inferior, wrong, or incorrect. In accordance with NVIDIA's code of conduct, we should strive to avoid non-inclusive terms like "sanity" and use neutral and inclusive language instead. The term "sanity" is listed as a non-inclusive term to avoid by a number of technical and standards organizations: W3C: https://w3c.github.io/manual-of-style/#inclusive IETF: https://github.com/ietf/terminology Google Engineering: https://developers.google.com/style/inclusive-documentation Twitter Engineering INCITS (US national standards) ISO (international standards)
1 parent b829f4a commit 2d2c999

File tree

11 files changed

+99
-100
lines changed

11 files changed

+99
-100
lines changed

cmake/filecheck_confidence_test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIDENCE

cmake/sanity

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ if (THRUST_ENABLE_EXAMPLE_FILECHECK)
2828
endif()
2929

3030
execute_process(
31-
COMMAND "${THRUST_FILECHECK_EXECUTABLE}" "${filecheck_data_path}/thrust.sanity.filecheck"
32-
INPUT_FILE "${Thrust_SOURCE_DIR}/cmake/sanity"
31+
COMMAND "${THRUST_FILECHECK_EXECUTABLE}" "${filecheck_data_path}/thrust.confidence.filecheck"
32+
INPUT_FILE "${Thrust_SOURCE_DIR}/cmake/filecheck_confidence_test"
3333
RESULT_VARIABLE exit_code
3434
)
3535

examples/sparse_vector.cu

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ template <typename IndexVector,
1111
void print_sparse_vector(const IndexVector& A_index,
1212
const ValueVector& A_value)
1313
{
14-
// sanity test
1514
assert(A_index.size() == A_value.size());
1615

1716
for(size_t i = 0; i < A_index.size(); i++)
@@ -35,7 +34,6 @@ void sum_sparse_vectors(const IndexVector1& A_index,
3534
typedef typename IndexVector3::value_type IndexType;
3635
typedef typename ValueVector3::value_type ValueType;
3736

38-
// sanity test
3937
assert(A_index.size() == A_value.size());
4038
assert(B_index.size() == B_value.size());
4139

@@ -53,7 +51,7 @@ void sum_sparse_vectors(const IndexVector1& A_index,
5351
B_value.begin(),
5452
temp_index.begin(),
5553
temp_value.begin());
56-
54+
5755
// compute number of unique indices
5856
size_t C_size = thrust::inner_product(temp_index.begin(), temp_index.end() - 1,
5957
temp_index.begin() + 1,
@@ -83,7 +81,7 @@ int main(void)
8381
A_index[1] = 3; A_value[1] = 60;
8482
A_index[2] = 5; A_value[2] = 20;
8583
A_index[3] = 8; A_value[3] = 40;
86-
84+
8785
// initialize sparse vector B with 6 elements
8886
thrust::device_vector<int> B_index(6);
8987
thrust::device_vector<float> B_value(6);
@@ -97,7 +95,7 @@ int main(void)
9795
// compute sparse vector C = A + B
9896
thrust::device_vector<int> C_index;
9997
thrust::device_vector<float> C_value;
100-
98+
10199
sum_sparse_vectors(A_index, A_value, B_index, B_value, C_index, C_value);
102100

103101
std::cout << "Computing C = A + B for sparse vectors A and B" << std::endl;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHECK: CONFIDENCE

internal/test/thrust.sanity.filecheck

Lines changed: 0 additions & 1 deletion
This file was deleted.

internal/test/thrust_nightly.pl

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ sub process_return_code {
182182

183183
my $have_filecheck = 1;
184184

185-
sub filecheck_sanity {
186-
my $filecheck_cmd = "$filecheck_path/FileCheck $filecheck_data_path/thrust.sanity.filecheck";
185+
sub filecheck_test {
186+
my $filecheck_cmd = "$filecheck_path/FileCheck $filecheck_data_path/thrust.confidence.filecheck";
187187

188188
my $filecheck_pid = open(my $filecheck_stdin, "|-", "$filecheck_cmd 2>&1");
189189

190-
print $filecheck_stdin "SANITY";
190+
print $filecheck_stdin "CONFIDENCE";
191191

192192
my $filecheck_ret = 0;
193193
if (close($filecheck_stdin) == 0)
@@ -196,21 +196,21 @@ sub filecheck_sanity {
196196
}
197197

198198
if ($filecheck_ret == 0) {
199-
printf("#### SANE FileCheck\n");
199+
printf("&&&& PASSED FileCheck\n");
200200
} else {
201201
# Use a temporary file to send the output to
202202
# FileCheck so we can get the output this time,
203203
# because Perl and bidirectional pipes suck.
204204
my $tmp = File::Temp->new();
205205
my $tmp_filename = $tmp->filename;
206-
print $tmp "SANITY";
206+
print $tmp "CONFIDENCE";
207207

208208
printf("********************************************************************************\n");
209209
print `$filecheck_cmd -input-file $tmp_filename`;
210210
printf("********************************************************************************\n");
211211

212-
process_return_code("FileCheck Sanity", $filecheck_ret, "");
213-
printf("#### INSANE FileCheck\n");
212+
process_return_code("FileCheck Test", $filecheck_ret, "");
213+
printf("&&&& FAILED FileCheck\n");
214214

215215
$have_filecheck = 0;
216216
}
@@ -243,7 +243,7 @@ sub run_cmd {
243243
{
244244
$ret = $?;
245245
}
246-
246+
247247
alarm 0;
248248
};
249249
my $elapsed = timestamp() - $start;
@@ -286,7 +286,7 @@ sub run_examples {
286286
{
287287
my $test_exe = $test;
288288

289-
# Ignore FileCheck files.
289+
# Ignore FileCheck files.
290290
if ($test =~ /[.]filecheck$/)
291291
{
292292
next;
@@ -403,7 +403,7 @@ sub run_unit_tests {
403403
{
404404
my $test_exe = $test;
405405

406-
# Ignore FileCheck files.
406+
# Ignore FileCheck files.
407407
if ($test =~ /[.]filecheck$/)
408408
{
409409
next;
@@ -558,6 +558,7 @@ sub dvs_summary {
558558

559559
printf("\n");
560560

561+
# We can't remove "sanity" here yet because DVS looks for this exact string.
561562
printf("CUDA DVS BASIC SANITY SCORE : %.1f\n", $dvs_score);
562563

563564
if ($failures + $errors > 0) {
@@ -582,7 +583,7 @@ sub dvs_summary {
582583

583584
printf("\n");
584585

585-
filecheck_sanity();
586+
filecheck_test();
586587

587588
printf("\n");
588589

testing/unittest/cuda/testframework.cu

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ void list_devices(void)
2929
{
3030
std::cout << "There is no device supporting CUDA" << std::endl;
3131
}
32-
32+
3333
int selected_device;
3434
cudaGetDevice(&selected_device);
35-
35+
3636
for (int dev = 0; dev < deviceCount; ++dev)
3737
{
3838
cudaDeviceProp deviceProp;
3939
cudaGetDeviceProperties(&deviceProp, dev);
40-
40+
4141
if(dev == 0)
4242
{
4343
if(deviceProp.major == 9999 && deviceProp.minor == 9999)
@@ -47,12 +47,12 @@ void list_devices(void)
4747
else
4848
std::cout << "There are " << deviceCount << " devices supporting CUDA" << std:: endl;
4949
}
50-
50+
5151
std::cout << "\nDevice " << dev << ": \"" << deviceProp.name << "\"";
5252
if(dev == selected_device)
5353
std::cout << " [SELECTED]";
5454
std::cout << std::endl;
55-
55+
5656
std::cout << " Major revision number: " << deviceProp.major << std::endl;
5757
std::cout << " Minor revision number: " << deviceProp.minor << std::endl;
5858
std::cout << " Total amount of global memory: " << deviceProp.totalGlobalMem << " bytes" << std::endl;
@@ -70,16 +70,16 @@ template<typename Iterator> Iterator my_next(Iterator iter)
7070
std::vector<int> CUDATestDriver::target_devices(const ArgumentMap &kwargs)
7171
{
7272
std::vector<int> result;
73-
73+
7474
// by default, test all devices in the system (device id -1)
7575
int device_id = kwargs.count("device") ? atoi(kwargs.find("device")->second.c_str()) : -1;
76-
76+
7777
if(device_id < 0)
7878
{
7979
// target all devices in the system
8080
int count = 0;
8181
cudaGetDeviceCount(&count);
82-
82+
8383
result.resize(count);
8484
std::iota(result.begin(), result.end(), 0);
8585
}
@@ -88,7 +88,7 @@ std::vector<int> CUDATestDriver::target_devices(const ArgumentMap &kwargs)
8888
// target the specified device
8989
result = std::vector<int>(1,device_id);
9090
}
91-
91+
9292
return result;
9393
}
9494

@@ -105,12 +105,12 @@ bool CUDATestDriver::check_cuda_error(bool concise)
105105
<< std::string(cudaGetErrorString(error))
106106
<< "]" << std::endl;
107107
}
108-
}
108+
}
109109

110110
return cudaSuccess != error;
111111
}
112112

113-
bool CUDATestDriver::post_test_sanity_check(const UnitTest &test, bool concise)
113+
bool CUDATestDriver::post_test_confidence_check(const UnitTest &test, bool concise)
114114
{
115115
cudaError_t const error = cudaDeviceSynchronize();
116116
if(cudaSuccess != error)
@@ -127,7 +127,7 @@ bool CUDATestDriver::post_test_sanity_check(const UnitTest &test, bool concise)
127127

128128
return cudaSuccess == error;
129129
}
130-
130+
131131
bool CUDATestDriver::run_tests(const ArgumentSet &args, const ArgumentMap &kwargs)
132132
{
133133
bool verbose = kwargs.count("verbose");
@@ -142,17 +142,17 @@ bool CUDATestDriver::run_tests(const ArgumentSet &args, const ArgumentMap &kwarg
142142

143143
// check error status before doing anything
144144
if(check_cuda_error(concise)) return false;
145-
145+
146146
bool result = true;
147147

148148
if(kwargs.count("verbose"))
149149
{
150150
list_devices();
151151
}
152-
152+
153153
// figure out which devices to target
154154
std::vector<int> devices = target_devices(kwargs);
155-
155+
156156
// target each device
157157
for(std::vector<int>::iterator device = devices.begin();
158158
device != devices.end();
@@ -170,7 +170,7 @@ bool CUDATestDriver::run_tests(const ArgumentSet &args, const ArgumentMap &kwarg
170170
// note which device we're skipping
171171
cudaDeviceProp deviceProp;
172172
cudaGetDeviceProperties(&deviceProp, *device);
173-
173+
174174
std::cout << "Skipping Device " << *device << ": \"" << deviceProp.name << "\"" << std::endl;
175175

176176
continue;
@@ -181,23 +181,23 @@ bool CUDATestDriver::run_tests(const ArgumentSet &args, const ArgumentMap &kwarg
181181
// note which device we're testing
182182
cudaDeviceProp deviceProp;
183183
cudaGetDeviceProperties(&deviceProp, *device);
184-
184+
185185
std::cout << "Testing Device " << *device << ": \"" << deviceProp.name << "\"" << std::endl;
186186
}
187187

188188
// check error status before running any tests
189189
if(check_cuda_error(concise)) return false;
190-
190+
191191
// run tests
192192
result &= UnitTestDriver::run_tests(args, kwargs);
193-
193+
194194
if(!concise && my_next(device) != devices.end())
195195
{
196196
// provide some separation between the output of separate tests
197197
std::cout << std::endl;
198198
}
199199
}
200-
200+
201201
return result;
202202
}
203203

testing/unittest/cuda/testframework.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CUDATestDriver
1616

1717
bool check_cuda_error(bool concise);
1818

19-
virtual bool post_test_sanity_check(const UnitTest &test, bool concise);
19+
virtual bool post_test_confidence_check(const UnitTest &test, bool concise);
2020

2121
virtual bool run_tests(const ArgumentSet &args, const ArgumentMap &kwargs);
2222
};

0 commit comments

Comments
 (0)