Files
rocm-systems/rocclr/runtime/device/cpu/cpumapping.hpp
T
foreman 5632ebd275 P4 to Git Change 1185139 by fdaniil@spb_fdaniil_amd_hsa_brigvar_test on 2015/08/27 08:31:20
ECR #304775 - prepare to build with MSVC 18, part 3:
	changes in runtime/ugl

	testing done: smoke, precheckin
	reviewers: German Andryeyev, Bart Crane

	http://ocltc.amd.com/reviews/r/8338/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpucommand.cpp#65 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpudevice.cpp#274 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpumapping.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpumapping.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpuvirtual.cpp#25 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#183 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#116 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#521 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpukernel.cpp#295 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprintf.cpp#37 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuprogram.cpp#204 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#375 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsadevice.cpp#93 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsakernel.cpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.cpp#37 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsakernel.cpp#9 edit
... //depot/stg/opencl/drivers/opencl/runtime/os/os_posix.cpp#40 edit
... //depot/stg/opencl/drivers/opencl/runtime/os/os_win32.cpp#45 edit
2015-08-27 08:40:14 -04:00

44 righe
1.9 KiB
C++

//
// Copyright (c) 2011 Advanced Micro Devices, Inc. All rights reserved.
//
// HCtoDCmap provides a mapping of parameters from host compiler to device compiler
// The mapping can be used to copy parameters from host to device where field alignment
// is different in compilers
#ifndef CPUMAPPING_HPP_
#define CPUMAPPING_HPP_
namespace cpu {
class HCtoDCmap
{
public:
unsigned int hc_offset, hc_size; // Offset and size of this parameter in host compiler
unsigned int dc_offset, dc_size; // Offset and size of this parameter in device compiler
unsigned int hc_alignment; // Alignment of parameter in host compiler
unsigned int dc_alignment; // Alignment of parameter in device compiler
clk_value_type_t type; // Type of parameter
HCtoDCmap *internal_field_map; // Pointer to internal mapping when current parameter is of type T_STRUCT
HCtoDCmap *next_field_map; // Pointer to next struct field when current parameter is a struct member
HCtoDCmap(const clk_parameter_descriptor_t*, unsigned int, unsigned int, unsigned int);
virtual ~HCtoDCmap();
int compute_map(const clk_parameter_descriptor_t*, unsigned int &, unsigned int &, unsigned int, int&, int&);
unsigned next_offset(unsigned, unsigned &, int &);
size_t getHostScalarParamSize(const clk_value_type_t) const;
size_t getScalarAlignment(const clk_value_type_t, bool) const;
void align_map(unsigned, unsigned, unsigned&, unsigned&, int&);
unsigned int copy_params(void *, const void *, unsigned int, int&, int&) const;
private:
};
} // namespace cpu
#endif // CPUMAPPING_HPP_
// Mapping rule
// Long types are treated with 8 byte alignment in runtime when passed in as arguments
// but they are treated with 4 byte alignment in compiler
// Double members have 8 byte alignment when passed as scalar argument
// but have 4 byte alignment as a field inside a struct