Compute Library
 22.08
winograd_input_transform.cl File Reference
#include "helpers.h"
#include "tile_helpers.h"

Go to the source code of this file.

Macros

#define OUTPUT_ROW_4x4_5x5(out, tmp, comm_fact)
 
#define OUTPUT_ROW_2x2_7x7(out, tmp, comm_fact)
 

Macro Definition Documentation

◆ OUTPUT_ROW_2x2_7x7

#define OUTPUT_ROW_2x2_7x7 (   out,
  tmp,
  comm_fact 
)
Value:
({ \
comm_fact.s0 = 36.0f * tmp.s2 - 13.0f * tmp.s4 + tmp.s6; \
comm_fact.s1 = 36.0f * tmp.s1 - 13.0f * tmp.s3 + 1.0f * tmp.s5; \
comm_fact.s2 = 9.0f * tmp.s2 - 10.0f * tmp.s4 + tmp.s6; \
comm_fact.s3 = 18.0f * tmp.s1 - 20.0f * tmp.s3 + 2.0f * tmp.s5; \
comm_fact.s4 = 4.0f * tmp.s2 - 5.0f * tmp.s4 + tmp.s6; \
comm_fact.s5 = 12.0f * tmp.s1 - 15.0f * tmp.s3 + 3.0f * tmp.s5; \
out.s0 = -36.0f * tmp.s0 + 49.0f * tmp.s2 + -14.0f * tmp.s4 + tmp.s6; \
out.s1 = comm_fact.s0 - comm_fact.s1; \
out.s2 = comm_fact.s0 + comm_fact.s1; \
out.s3 = comm_fact.s2 - comm_fact.s3; \
out.s4 = comm_fact.s2 + comm_fact.s3; \
out.s5 = comm_fact.s4 - comm_fact.s5; \
out.s6 = comm_fact.s4 + comm_fact.s5; \
out.s7 = -36.0f * tmp.s1 + 0.0f * tmp.s2 + 49.0f * tmp.s3 - 14.0f * tmp.s5 + tmp.s7; \
})

Definition at line 47 of file winograd_input_transform.cl.

◆ OUTPUT_ROW_4x4_5x5

#define OUTPUT_ROW_4x4_5x5 (   out,
  tmp,
  comm_fact 
)
Value:
({ \
comm_fact.s0 = tmp.s2 - 4.25f * tmp.s4 + tmp.s6; \
comm_fact.s1 = tmp.s1 - 4.25f * tmp.s3 + tmp.s5; \
comm_fact.s2 = 2.5f * tmp.s3; \
comm_fact.s3 = 0.5f * tmp.s1 + 2.f * tmp.s5 - comm_fact.s2; \
comm_fact.s4 = 0.25f * tmp.s2 - 1.25f * tmp.s4 + tmp.s6; \
comm_fact.s5 = 4.f * tmp.s2 + tmp.s6 - 5.f * tmp.s4; \
comm_fact.s6 = 2.f * tmp.s1 + 0.5f * tmp.s5 - comm_fact.s2; \
\
out.s0 = tmp.s0 - tmp.s6 + 5.25f * tmp.s4 - 5.25f * tmp.s2; \
out.s1 = comm_fact.s0 + comm_fact.s1; \
out.s2 = comm_fact.s0 - comm_fact.s1; \
out.s3 = comm_fact.s3 + comm_fact.s4; \
out.s4 = comm_fact.s4 - comm_fact.s3; \
out.s5 = comm_fact.s5 + comm_fact.s6; \
out.s6 = comm_fact.s5 - comm_fact.s6; \
out.s7 = tmp.s7 - tmp.s1 + 5.25f * tmp.s3 - 5.25f * tmp.s5; \
})

Definition at line 27 of file winograd_input_transform.cl.