Skip to content

Commit

Permalink
bugfix: wrong catalog definition at sum(float2/float4)
Browse files Browse the repository at this point in the history
reported at heterodb#615
This commit also fixes the problem to cast float2 -> float8 on GPU devices.
  • Loading branch information
kaigai committed Jul 27, 2023
1 parent 11587e7 commit d95639d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/float2.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ fp16_to_fp32(float2_t fp16val)
}

INLINE_FUNCTION(float8_t)
fp16_to_fp64(half_t fp16val)
fp16_to_fp64(float2_t fp16val)
{
#ifndef EMULATE_FLOAT2
return (float8_t)fp16val;
Expand Down
4 changes: 2 additions & 2 deletions src/gpu_preagg.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ static aggfunc_catalog_t aggfunc_catalog_array[] = {
},
{"sum(float2)",
"c:sum(float8)",
"s:psum(float4)",
"s:psum(float8)",
KAGG_ACTION__PSUM_FP, false
},
{"sum(float4)",
"s:sum_f4(float8)",
"s:psum(float4)",
"s:psum(float8)",
KAGG_ACTION__PSUM_FP, false
},
{"sum(float8)",
Expand Down
6 changes: 3 additions & 3 deletions src/sql/pg_strom--5.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2898,9 +2898,9 @@ CREATE FUNCTION pgstrom.psum(int8)
LANGUAGE C STRICT PARALLEL SAFE;

CREATE FUNCTION pgstrom.psum(float4)
RETURNS float4
AS 'MODULE_PATHNAME','pgstrom_partial_sum_asis'
LANGUAGE C STRICT PARALLEL SAFE;
RETURNS float8
AS 'ftod'
LANGUAGE internal STRICT PARALLEL SAFE;

CREATE FUNCTION pgstrom.psum(float8)
RETURNS float8
Expand Down

0 comments on commit d95639d

Please sign in to comment.