Git Product home page Git Product logo

geiger's People

Contributors

david-grs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geiger's Issues

Header-only ... but papi dependency ?

It appears that geiger is header-only as promised but then has dependencies on

  • gtest for its own unit tests (fair enough, we can live with this)
  • papi for its actual operations :-/

Any interest in making that optional?

Bench result output format?

image

Hi, this is the bench result output format I'm seeing.
It is not equal to the one on your examples with the 'time' column.
Is this normal?

The full code used is below

#include <iostream>
#include <cstdlib>
#include <cmath>
#include <chrono>
#include <algorithm>
#include <geiger/geiger.h>

__global__ void hadamard(size_t n, float* a, float* b, float* c)
{
    int const id = blockIdx.x * blockDim.x + threadIdx.x;
    if(id < n)
	c[id] = a[id] * b[id];
}

__global__ void hadamard_fast(size_t n, float* a, float* b, float* c)
{
    int const id = blockIdx.x * blockDim.x + threadIdx.x;
    if(id < n)
	c[id] = __fmul_rn(a[id], b[id]);
}

int main()
{
    geiger::init();
    geiger::suite<> suite;

    size_t size = 1000;

    int block_size = 64;
    int grid_size = (int)ceil((float)size/block_size);

    float* a = (float*)malloc(sizeof(float)*size);
    float* b = (float*)malloc(sizeof(float)*size);
    float* c = (float*)malloc(sizeof(float)*size);

    std::fill(a, a + size, 5);
    std::fill(b, b + size, 3);

    float* d_a;
    float* d_b;
    float* d_c;

    cudaMalloc(&d_a, sizeof(float)*size);
    cudaMalloc(&d_b, sizeof(float)*size);
    cudaMalloc(&d_c, sizeof(float)*size);

    cudaMemcpy(d_a, a, sizeof(float) * size, cudaMemcpyHostToDevice);
    cudaMemcpy(d_b, b, sizeof(float) * size, cudaMemcpyHostToDevice);
    cudaMemcpy(d_c, c, sizeof(float) * size, cudaMemcpyHostToDevice);

    suite.add("hadamard standard", [d_a, d_b, d_c,
				    size, block_size, grid_size]()
	      {
		  hadamard<<<grid_size, block_size>>>(size, d_a, d_b, d_c);
	      })
	.add("hadamard fast", [d_a, d_b, d_c,
			       size, block_size, grid_size]()
	      {
		  hadamard_fast<<<grid_size, block_size>>>(size, d_a, d_b, d_c);
	      })
	.set_printer<geiger::printer::console<>>()
	.run(std::chrono::milliseconds(1));

    cudaMemcpy(c, d_c, sizeof(float) * size, cudaMemcpyDeviceToHost);

    std::cout << "result: " << c[0] << std::endl;

    cudaFree(d_a);
    cudaFree(d_b);
    cudaFree(d_c);
    free(a);
    free(b);
    free(c);

    return 0;
}

papi issue

On a very standard Ubuntu 16.10 box I am seeing:

edd@brad:~/git/geiger/build(master)$ examples/walk 
Test                Time (ns)       L1 DCM       L2 DCM       L3 TCM
--------------------------------------------------------------------
terminate called after throwing an instance of 'std::runtime_error'
  what():  PAPI_start_counters failed with events: PAPI_L1_DCM PAPI_L2_DCM PAPI_L3_TCM : Event does not exist
Aborted (core dumped)
edd@brad:~/git/geiger/build(master)$ 

Same with other examples and some tests. Is that expected?

Documentation missing: set timing printing precision, unit

I've just now used this very nice library to benchmark some answers on a stackoverflow performance optimization question:

Convert two integers into a single float value

unfortunately, the best solutions take around 1 ns / iteration or less... which means that the results printout isn't accurate enough. I'm sure you have options to increase the printed value precision, or change the timing unit from nanosecond to picosecond (if not - I'll open another issue). But - there's no documentation on how to make that happen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.