Skip to content

Commit

Permalink
Merge branch 'master' into tensorflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Casper committed Nov 2, 2016
2 parents 99c0da5 + b3e398a commit 13d1e16
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
3 changes: 3 additions & 0 deletions include/ctc.h
Expand Up @@ -21,6 +21,9 @@ typedef enum {
CTC_STATUS_UNKNOWN_ERROR = 4
} ctcStatus_t;

/** Returns a single integer which specifies the API version of the warpctc library */
int get_warpctc_version();

/** Returns a string containing a description of status that was passed in
* \param[in] status identifies which string should be returned
* \return C style string containing the text description
Expand Down
4 changes: 4 additions & 0 deletions src/ctc_entrypoint.cpp
Expand Up @@ -12,6 +12,10 @@

extern "C" {

int get_warpctc_version() {
return 1;
}

const char* ctcGetStatusString(ctcStatus_t status) {
switch (status) {
case CTC_STATUS_SUCCESS:
Expand Down
12 changes: 10 additions & 2 deletions tests/test_cpu.cpp
Expand Up @@ -366,6 +366,11 @@ bool run_tests() {
}

int main(void) {
if (get_warpctc_version() != 1) {
std::cerr << "Invalid WarpCTC version." << std::endl;
return 1;
}

std::cout << "Running CPU tests" << std::endl;

bool status = true;
Expand All @@ -374,8 +379,11 @@ int main(void) {
status &= inf_test();
status &= run_tests();

if (status)
if (status) {
std::cout << "Tests pass" << std::endl;
else
return 0;
} else {
std::cout << "Some or all tests fail" << std::endl;
return 1;
}
}
12 changes: 10 additions & 2 deletions tests/test_gpu.cu
Expand Up @@ -478,6 +478,11 @@ bool run_tests() {
}

int main(void) {
if (get_warpctc_version() != 1) {
std::cerr << "Invalid WarpCTC version." << std::endl;
return 1;
}

std::cout << "Running GPU tests" << std::endl;
throw_on_error(cudaSetDevice(0), "cudaSetDevice");

Expand All @@ -487,8 +492,11 @@ int main(void) {
status &= inf_test();
status &= run_tests();

if (status)
if (status) {
std::cout << "Tests pass" << std::endl;
else
return 0;
} else {
std::cout << "Some or all tests fail" << std::endl;
return 1;
}
}

0 comments on commit 13d1e16

Please sign in to comment.