Ignore:
Timestamp:
Aug 29, 2011, 7:03:07 PM (8 years ago)
Author:
sam
Message:

core: tune the half precision code so that the best variants are being
used on the PS3 platform.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/lol-bench.cpp

    r877 r879  
    6767        timer.GetMs();
    6868        half::convert(pf, ph, HALF_TABLE_SIZE);
    69         result[1] += timer.GetMs();
     69        result[0] += timer.GetMs();
    7070
    7171        /* Convert half to float (fast) */
     
    7373        for (size_t i = 0; i < HALF_TABLE_SIZE; i++)
    7474            pf[i] = (float)ph[i];
    75         result[0] += timer.GetMs();
     75        result[1] += timer.GetMs();
    7676
    7777        /* Convert float to half (array) */
    7878        timer.GetMs();
    7979        half::convert(ph, pf, HALF_TABLE_SIZE);
    80         result[4] += timer.GetMs();
     80        result[2] += timer.GetMs();
    8181
    8282        /* Convert float to half (fast) */
     
    8484        for (size_t i = 0; i < HALF_TABLE_SIZE; i++)
    8585            ph[i] = (half)pf[i];
    86         result[2] += timer.GetMs();
     86        result[3] += timer.GetMs();
    8787
    88         /* Convert float to half (slow) */
     88        /* Convert float to half (accurate) */
    8989        timer.GetMs();
    9090        for (size_t i = 0; i < HALF_TABLE_SIZE; i++)
    91             ph[i] = half::makeslow(pf[i]);
    92         result[3] += timer.GetMs();
     91            ph[i] = half::makeaccurate(pf[i]);
     92        result[4] += timer.GetMs();
    9393
    9494        /* Change sign of every half */
     
    117117        result[i] *= 1000000.0f / (HALF_TABLE_SIZE * HALF_RUNS);
    118118
    119     Log::Info("                         ns/elem\n");
    120     Log::Info("float = half            %7.3f\n", result[0]);
    121     Log::Info("float[] = half[]        %7.3f\n", result[1]);
    122     Log::Info("half = float            %7.3f\n", result[2]);
    123     Log::Info("half = makeslow(float)  %7.3f\n", result[3]);
    124     Log::Info("half[] = float[]        %7.3f\n", result[4]);
    125     Log::Info("half = -half            %7.3f\n", result[5]);
    126     Log::Info("float += half           %7.3f\n", result[6]);
    127     Log::Info("half += float           %7.3f\n", result[7]);
     119    Log::Info("                          ns/elem\n");
     120    Log::Info("float[] = half[]         %7.3f\n", result[0]);
     121    Log::Info("float = half             %7.3f\n", result[1]);
     122    Log::Info("half[] = float[]         %7.3f\n", result[2]);
     123    Log::Info("half = float (fast)      %7.3f\n", result[3]);
     124    Log::Info("half = float (accurate)  %7.3f\n", result[4]);
     125    Log::Info("half = -half             %7.3f\n", result[5]);
     126    Log::Info("float += half            %7.3f\n", result[6]);
     127    Log::Info("half += float            %7.3f\n", result[7]);
    128128}
    129129
Note: See TracChangeset for help on using the changeset viewer.