-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working on task definitions for identity example
- Loading branch information
Showing
7 changed files
with
87 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef __TASK_H__ | ||
#define __TASK_H__ | ||
|
||
#include <vector> | ||
#include <array> | ||
|
||
#define N_SIZES 10 | ||
const int Ns[N_SIZES] = {128, 256, 512, 1024, 2048, | ||
4096, 8192, 16384, 32768, 65536}; | ||
|
||
using input_t = std::array<std::vector<float>, N_SIZES>; | ||
using output_t = input_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef POPCORN_UTILS_H | ||
#define POPCORN_UTILS_H | ||
|
||
#include <iostream> | ||
|
||
// checks that a CUDA API call returned successfully, otherwise prints an error message and exits. | ||
static inline void cuda_check_(cudaError_t status, const char* expr, const char* file, int line, const char* function) | ||
{ | ||
if(status != cudaSuccess) { | ||
std::cerr << "CUDA error (" << (int)status << ") while evaluating expression " | ||
<< expr << " at " | ||
<< file << '(' | ||
<< line << ") in `" | ||
<< function << "`: " | ||
<< cudaGetErrorString(status) << std::endl; | ||
std::exit(110); | ||
} | ||
} | ||
|
||
// Convenience macro, automatically logs expression, file, line, and function name | ||
// of the error. | ||
#define CUDA_CHECK(expr) cuda_check_(expr, #expr, __FILE__, __LINE__, __FUNCTION__) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters