Skip to content

Instantly share code, notes, and snippets.

View lambday's full-sized avatar

Soumyajit De lambday

  • Meta
  • London
  • 05:59 (UTC)
View GitHub Profile
[[email protected] saurabh]$ g++ -std=c++14 -O3 -w eigen_sqrt.cpp -I/usr/include/eigen3
[[email protected] saurabh]$ ./a.out
default ctor called.
default ctor called.
default ctor called.
default ctor called.
default ctor called.
default ctor called.
Task 1
initializer ctor called.
/*
* Copyright (c) 2016, Shogun-Toolbox e.V. <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[[email protected] oxphos]$ ./benchmark
[==========] Running 2 benchmarks.
[ RUN ] SGVector.explict(data.A, data.B) (10 runs, 1000 iterations per run)
[ DONE ] SGVector.explict(data.A, data.B) (841.955000 ms)
[ RUNS ] Average time: 84195.500 us
Fastest: 78455.000 us (-5740.500 us / -6.818 %)
Slowest: 123583.000 us (+39387.500 us / +46.781 %)
Average performance: 11.87712 runs/s
Best performance: 12.74616 runs/s (+0.86904 runs/s / +7.31693 %)
[[email protected] oxphos]$ ./benchmark
[==========] Running 2 benchmarks.
[ RUN ] SGVector.explict(data.A, data.B) (10 runs, 1000 iterations per run)
[ DONE ] SGVector.explict(data.A, data.B) (809.396000 ms)
[ RUNS ] Average time: 80939.600 us
Fastest: 78482.000 us (-2457.600 us / -3.036 %)
Slowest: 97388.000 us (+16448.400 us / +20.322 %)
Average performance: 12.35489 runs/s
Best performance: 12.74178 runs/s (+0.38688 runs/s / +3.13142 %)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <linalg.h>
#include <shogun/lib/SGVector.h>
using namespace shogun;
template <class T>
struct GPUVector<T>::GPUArray
{
GPUArray(){}
};
samples_p = DenseRealFeatures(numpy_matrix_p)
samples_q = DenseRealFeatures(numpy_matrix_q)
# samples_p = StreamingDenseRealFeatures(file_p)
# samples_q = StreamingDenseRealFeatures(file_q)
mmd = LinearTimeMMD(samples_p, samples_q)
# mmd = QuadraticTimeMMD(samples_p, samples_q)
# mmd = BTestMMD(samples_p, samples_q)
alpha = 0.05
sigma = 0.25
num_runs = 10
class linalg
{
template <class T>
T dot(Vector<T>* a, Vector<T>* b)
{
if (a->onGPU() && b->onGPU()) {
if (this->hasGPUBackend()) {
// do the gpu backend dot product
// you shouldn't care whether it's viennacl or some other GPU backend.
return this->gpu_backend->dot(*static_cast<GPUVector<T>*>(a), *static_cast<GPUVector<T>*>(a));
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.