parent
96216628bf
commit
a1f7b94820
@ -6,7 +6,8 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Added
|
### Added
|
||||||
- OpenACC flags to build for Volta.
|
- OpenACC flags to build for Volta.
|
||||||
- Kokkos list CLI argument shows some information about which device will be used.
|
- Kokkos list CLI argument shows some information about which device will be used.
|
||||||
- OpenMP GNU compiler now uses native target flag
|
- OpenMP GNU compiler now uses native target flag.
|
||||||
|
- Support CSV output for Triad only running mode.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Update SYCL implementation to SYCL 1.2.1 interface.
|
- Update SYCL implementation to SYCL 1.2.1 interface.
|
||||||
|
|||||||
35
main.cpp
35
main.cpp
@ -285,6 +285,9 @@ void run()
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void run_triad()
|
void run_triad()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!output_as_csv)
|
||||||
{
|
{
|
||||||
std::cout << "Running triad " << num_times << " times" << std::endl;
|
std::cout << "Running triad " << num_times << " times" << std::endl;
|
||||||
std::cout << "Number of elements: " << ARRAY_SIZE << std::endl;
|
std::cout << "Number of elements: " << ARRAY_SIZE << std::endl;
|
||||||
@ -294,10 +297,6 @@ void run_triad()
|
|||||||
else
|
else
|
||||||
std::cout << "Precision: double" << std::endl;
|
std::cout << "Precision: double" << std::endl;
|
||||||
|
|
||||||
// Create host vectors
|
|
||||||
std::vector<T> a(ARRAY_SIZE);
|
|
||||||
std::vector<T> b(ARRAY_SIZE);
|
|
||||||
std::vector<T> c(ARRAY_SIZE);
|
|
||||||
std::streamsize ss = std::cout.precision();
|
std::streamsize ss = std::cout.precision();
|
||||||
std::cout << std::setprecision(1) << std::fixed
|
std::cout << std::setprecision(1) << std::fixed
|
||||||
<< "Array size: " << ARRAY_SIZE*sizeof(T)*1.0E-3 << " KB"
|
<< "Array size: " << ARRAY_SIZE*sizeof(T)*1.0E-3 << " KB"
|
||||||
@ -305,6 +304,12 @@ void run_triad()
|
|||||||
std::cout << "Total size: " << 3.0*ARRAY_SIZE*sizeof(T)*1.0E-3 << " KB"
|
std::cout << "Total size: " << 3.0*ARRAY_SIZE*sizeof(T)*1.0E-3 << " KB"
|
||||||
<< " (=" << 3.0*ARRAY_SIZE*sizeof(T)*1.0E-6 << " MB)" << std::endl;
|
<< " (=" << 3.0*ARRAY_SIZE*sizeof(T)*1.0E-6 << " MB)" << std::endl;
|
||||||
std::cout.precision(ss);
|
std::cout.precision(ss);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create host vectors
|
||||||
|
std::vector<T> a(ARRAY_SIZE);
|
||||||
|
std::vector<T> b(ARRAY_SIZE);
|
||||||
|
std::vector<T> c(ARRAY_SIZE);
|
||||||
|
|
||||||
Stream<T> *stream;
|
Stream<T> *stream;
|
||||||
|
|
||||||
@ -365,6 +370,27 @@ void run_triad()
|
|||||||
// Display timing results
|
// Display timing results
|
||||||
double total_bytes = 3 * sizeof(T) * ARRAY_SIZE * num_times;
|
double total_bytes = 3 * sizeof(T) * ARRAY_SIZE * num_times;
|
||||||
double bandwidth = 1.0E-9 * (total_bytes / runtime);
|
double bandwidth = 1.0E-9 * (total_bytes / runtime);
|
||||||
|
if (output_as_csv)
|
||||||
|
{
|
||||||
|
std::cout
|
||||||
|
<< "function" << csv_separator
|
||||||
|
<< "num_times" << csv_separator
|
||||||
|
<< "n_elements" << csv_separator
|
||||||
|
<< "sizeof" << csv_separator
|
||||||
|
<< "gbytes_per_sec" << csv_separator
|
||||||
|
<< "runtime"
|
||||||
|
<< std::endl;
|
||||||
|
std::cout
|
||||||
|
<< "Triad" << csv_separator
|
||||||
|
<< num_times << csv_separator
|
||||||
|
<< ARRAY_SIZE << csv_separator
|
||||||
|
<< sizeof(T) << csv_separator
|
||||||
|
<< bandwidth << csv_separator
|
||||||
|
<< runtime
|
||||||
|
<< std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
std::cout
|
std::cout
|
||||||
<< "--------------------------------"
|
<< "--------------------------------"
|
||||||
<< std::endl << std::fixed
|
<< std::endl << std::fixed
|
||||||
@ -372,6 +398,7 @@ void run_triad()
|
|||||||
<< runtime << std::endl
|
<< runtime << std::endl
|
||||||
<< "Bandwidth (GB/s): " << std::left << std::setprecision(3)
|
<< "Bandwidth (GB/s): " << std::left << std::setprecision(3)
|
||||||
<< bandwidth << std::endl;
|
<< bandwidth << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
delete stream;
|
delete stream;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user