Files
263-0007-00L-Advanced-Syste…/flopcounts/x86/variant_float_inlining_SoA_symmetry_ILP_4.py
T
[Quy Anh] «Elliot» Nguyen e7af3103e8 Perf plot
2026-06-18 11:59:50 +02:00

71 lines
2.0 KiB
Python

# FLOPCOUNT (everything inside the t-loop). EXP kept as its own op (one real exp() per call).
# section costs: overhead 4 ADD 4 MULT (+ reductions 4*K = 16 ADD, K=4) |
# distance pair 3 ADD 2 MULT 1 SQRT |
# ped-ped j 11 ADD 22 MULT 2 SQRT 1 DIV 1 EXP |
# obstacle 10 ADD 13 MULT 1 SQRT 1 DIV 1 EXP | update 7 ADD 17 MULT 3 SQRT 2 DIV
# ADDs: n_iter * (
# n_p * 20 +
# 0.5 * (n_p*n_p - n_p) * 3 +
# n_p * (n_p - 1) * 11 +
# n_p * board.n_obstacles * 10 +
# n_p * 7
# )
# MULTs: n_iter * (
# n_p * 4 +
# 0.5 * (n_p*n_p - n_p) * 2 +
# n_p * (n_p - 1) * 22 +
# n_p * board.n_obstacles * 13 +
# n_p * 17
# )
# DIVs: n_iter * (
# n_p * (n_p - 1) +
# n_p * board.n_obstacles +
# n_p * 2
# )
# SQRTs: n_iter * (
# 0.5 * (n_p*n_p - n_p) +
# n_p * (n_p - 1) * 2 +
# n_p * board.n_obstacles +
# n_p * 3
# )
# EXPs: n_iter * (
# n_p * (n_p - 1) +
# n_p * board.n_obstacles
# )
# total with EXP = 30: n_iter * ( 69 * n_p ** 2 - 16 * n_p + 55 * n_obstacles * n_p )
def adds(n_iter: int, n_p: int, n_obs: int = 2) -> int:
return int(n_iter * (n_p * 20 + 0.5 * (n_p * n_p - n_p) * 3 + n_p *
(n_p - 1) * 11 + n_p * n_obs * 10 + n_p * 7))
def mults(n_iter: int, n_p: int, n_obs: int = 2) -> int:
return int(n_iter * (n_p * 4 + 0.5 * (n_p * n_p - n_p) * 2 + n_p *
(n_p - 1) * 22 + n_p * n_obs * 13 + n_p * 17))
def divs(n_iter: int, n_p: int, n_obs: int = 2) -> int:
return int(n_iter * (n_p * (n_p - 1) + n_p * n_obs + n_p * 2))
def sqrts(n_iter: int, n_p: int, n_obs: int = 2) -> int:
return int(n_iter * (0.5 * (n_p * n_p - n_p) + n_p *
(n_p - 1) * 2 + n_p * n_obs + n_p * 3))
def exps(n_iter: int, n_p: int, n_obs: int = 2) -> int:
return int(n_iter * (n_p * (n_p - 1) + n_p * n_obs))
def total(n_iter: int, n_p: int, n_obs: int = 2) -> int:
return adds(n_iter, n_p, n_obs) + mults(n_iter, n_p, n_obs) + divs(
n_iter, n_p, n_obs) + sqrts(n_iter, n_p,
n_obs) + exps(n_iter, n_p, n_obs) * 30