# HTP Core Headers for Op Packages

HTP core exposes over 70 headers externally for usage in QNN op packages. This
set of headers provides data types, structs, macros, functions, classes and more
for the purposes of op implementation, optimization rule definition and their
registration. Op package implementers can utilize these data structures and
functionalities supported by HTP core. This document provides a general guideline
on how to use these headers.

Typically, only four headers need to be included in op package source files:
constraints.h, op\_package\_feature\_support.h, simple\_reg.h, and optimize.h.
These headers directly and indirectly include other headers from this header set.

These headers can be found in released QNN SDK, under directory include/HTP/core.
Please note that these headers may change in future QNN SDK releases, and HTP op
packages are required to be recompiled when new headers are released. In order
to minimize code changes, header contents in namespace *hnnx* should not be
directly used in op packages, as they are considered HTP core internal and may
change without announcement.

## HTP Core Headers Usage

Please use the following categories as a guideline for finding the symbols you need.

**Data Type**

- dtype.h          :   info and traits of data types
- dtype\_enum.h     :   data types

**Tensor**

- allocator.h      : memory class of tensor
- dtype\_enum.h     : data type of tensor
- memory\_layout.h  : memory layout of tensor
- padding.h        : padding of tensor
- shape.h          : shape of tensor
- template\_help.h  : tensor layout helpers
- template\_help\_tensor\_ext.h  : tensor layout helpers
- tensor.h         : types of tensor, accessor functions of tensor
- tensor\_info.h    : tensor properties about TCM memory and stored format

**Op Implementation**

- data type (listed above) : access info about data types used in tensors
- tensors   (listed above) : access info and data of input and output tensors
- afuncs.h         : auxiliary functions
- builtin\_intrinsics.h  : HVX built-in functions
- check\_hvx.h      : check if HVX is available
- conversions.h    : data type conversion, comparison and arithmetic functions
- float16.h        : float16 helper functions
- graph\_status.h   : enum as return value from op execute functions
- hvx\_mathops.h    : HVX math helper functions
- intrinsics.h     : HVX functions
- tile\_extract.h   : tile read and write

**Optimization Rule**

- constraints.h     : constraint rules in macros
- dtype\_enum.h     : data types
- interface\_defs.h : access OutputDef in external replacement functions
- match\_op.h       : functions used in match code part of optimization
- oexpr.h          : functions for constraint and replacement
- oexpr\_post.h     : functions for constraint and replacement
- optimize.h       : external replacement function interface, functions for generating shape op and const op, functions for generating Quickshape, various pre-defined replacement functions
- optimize\_defs.h  : constraint rules in macros
- optimize\_flags.h : constraints flags
- op\_def.h         : access OpDef in external replacement functions

**Cost Function**

- cost.h           : cost function in macros
- cost\_funcs.h     : cost function infrastructure
- op.h             : Op accessor for cost function usage

**Registration**

- flags.h          : registration flag macros
- op.h             : standard cost values
- opname\_tag.h     : utils for op names
- optimize.h       : macros for optimization registration
- ops\_opts\_registration.h  : registration infrastructure for Ops and Optimization rules
- ops\_opts\_registration\_defs.h   : consolidates all Ops and Optimization rule information
- op\_extra\_info.h  : op extra information interface
- op\_info.h        : op information interface
- op\_package\_name.h: current op package name as a string from compile flag
- op\_register.h    : macros for registering ops
- op\_register\_ext.h: macros for op, flag and cost registration
- op\_register\_types.h   : generation of op registration params for op construction
- op\_registry.h    : op factory interface, to register or generate ops
- op\_utils.h       : various op util functions
- typical\_op.h     : op’s infrastructure
- simple\_reg.h     : external op registration headers

**Logging**

- log.h            : for logging info, warning and error messages

**Performance Measurement**

- perf\_timing.h    : for measuring pcycles

**Op Parameter Order, Axis Parameter Adjustment, and Per-channel Scale Op**

- op\_package\_feature\_support.h  : for listing op parameter orders and default values, and for listing parameters needed axis adjustment, and for listing per-channel scale ops

Last Published: Jun 04, 2026

[Previous Topic
QNN HTP Optimization Utility Functions Usage Examples](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/common_optimization_utility_funcs_usage_examples.md) [Next Topic
Implementing Ops](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/implementing_ops.md)