~glcompbench-dev/glcompbench/blur-update

« back to all changes in this revision

Viewing changes to src/libmatrix/test/const_vec_test.cc

  • Committer: Jesse Barker
  • Date: 2012-01-27 22:26:02 UTC
  • mfrom: (74.1.5 libmatrix-util)
  • Revision ID: jesse.barker@linaro.org-20120127222602-osainr4na7opoiij
Merge of lp:~glcompbench-dev/glcompbench/libmatrix-util.

Updates glcompbench to reflect the latest lp:libmatrix, which, in and of itself,
conslidates code previously duplicated between glcompbench and glmark2 into
libmatrix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// Copyright (c) 2011 Linaro Limited
 
3
//
 
4
// All rights reserved. This program and the accompanying materials
 
5
// are made available under the terms of the MIT License which accompanies
 
6
// this distribution, and is available at
 
7
// http://www.opensource.org/licenses/mit-license.php
 
8
//
 
9
// Contributors:
 
10
//     Jesse Barker - original implementation.
 
11
//
 
12
#include <iostream>
 
13
#include "libmatrix_test.h"
 
14
#include "const_vec_test.h"
 
15
#include "../vec.h"
 
16
 
 
17
using LibMatrix::vec2;
 
18
using LibMatrix::vec3;
 
19
using LibMatrix::vec4;
 
20
using std::cout;
 
21
using std::endl;
 
22
 
 
23
void
 
24
Vec2TestConstOperator::run(const Options& options)
 
25
{
 
26
    const vec2 a(1.0, 1.0);
 
27
    const vec2 b(2.0, 2.0);
 
28
    vec2 aplusb(a + b);
 
29
    vec2 aminusb(a - b);
 
30
    vec2 atimesb(a * b);
 
31
    vec2 adivb(a / b);
 
32
    const float s(2.5);
 
33
    vec2 stimesb(s * b);
 
34
}
 
35
 
 
36
void
 
37
Vec3TestConstOperator::run(const Options& options)
 
38
{
 
39
    const vec3 a(1.0, 1.0, 1.0);
 
40
    const vec3 b(2.0, 2.0, 2.0);
 
41
    vec3 aplusb(a + b);
 
42
    vec3 aminusb(a - b);
 
43
    vec3 atimesb(a * b);
 
44
    vec3 adivb(a / b);
 
45
    const float s(2.5);
 
46
    vec3 stimesb(s * b);
 
47
}
 
48
 
 
49
void
 
50
Vec4TestConstOperator::run(const Options& options)
 
51
{
 
52
    const vec4 a(1.0, 1.0, 1.0, 1.0);
 
53
    const vec4 b(2.0, 2.0, 2.0, 2.0);
 
54
    vec4 aplusb(a + b);
 
55
    vec4 aminusb(a - b);
 
56
    vec4 atimesb(a * b);
 
57
    vec4 adivb(a / b);
 
58
    const float s(2.5);
 
59
    vec4 stimesb(s * b);
 
60
}